Skip to content
This repository has been archived by the owner on Dec 21, 2024. It is now read-only.

Commit

Permalink
Update comments, remove unused usings, etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
StrangeRanger committed Jan 25, 2024
1 parent 9a1d2a7 commit 0d81234
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 26 deletions.
12 changes: 6 additions & 6 deletions FAFB-PowerShell-Tool/ComboBoxParameterViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Windows.Controls;

namespace FAFB_PowerShell_Tool;

Expand All @@ -9,9 +8,7 @@ namespace FAFB_PowerShell_Tool;
/// </summary>
public class ComboBoxParameterViewModel : INotifyPropertyChanged
{
/// <summary>
/// This is the event handler for the INotifyPropertyChanged interface.
/// </summary>

public event PropertyChangedEventHandler? PropertyChanged;

private ObservableCollection<string> _possibleParameterList;
Expand All @@ -28,7 +25,10 @@ public ObservableCollection<string> PossibleParameterList
}
}

// Constructor
/// <summary>
/// Class constructor.
/// </summary>
/// <param name="possibleParameterList">List of possible parameters for the corresponding command.</param>
public ComboBoxParameterViewModel(ObservableCollection<string> possibleParameterList)

Check warning on line 32 in FAFB-PowerShell-Tool/ComboBoxParameterViewModel.cs

View workflow job for this annotation

GitHub Actions / build (x64)

Non-nullable field '_possibleParameterList' must contain a non-null value when exiting constructor. Consider declaring the field as nullable.
{
PossibleParameterList = possibleParameterList;
Expand All @@ -37,7 +37,7 @@ public ComboBoxParameterViewModel(ObservableCollection<string> possibleParameter
/// <summary>
/// This is the method that is called when a property is changed.
/// </summary>
/// <param name="propertyName">...</param>
/// <param name="propertyName">Property that changed.</param>
protected virtual void OnPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
Expand Down
35 changes: 18 additions & 17 deletions FAFB-PowerShell-Tool/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,15 @@

namespace FAFB_PowerShell_Tool;

/// <summary>
/// Primary view model for the MainWindow.
/// </summary>
public class MainWindowViewModel : INotifyPropertyChanged
{
/// <summary>
/// This is the event handler for the INotifyPropertyChanged interface.
/// </summary>
public event PropertyChangedEventHandler? PropertyChanged;
public ObservableCollection<Command> ActiveDirectoryCommandList { get; private set; }
public ObservableCollection<string> PossibleParameterList { get; private set; }
public ObservableCollection<ComboBoxParameterViewModel> DynamicParameterCollection { get; private set; }
Expand Down Expand Up @@ -42,7 +49,7 @@ public string PowerShellOutput
}

/// <summary>
/// Constructor...
/// Class constructor.
/// </summary>
public MainWindowViewModel()

Check warning on line 54 in FAFB-PowerShell-Tool/MainWindowViewModel.cs

View workflow job for this annotation

GitHub Actions / build (x64)

Non-nullable property 'ActiveDirectoryCommandList' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 54 in FAFB-PowerShell-Tool/MainWindowViewModel.cs

View workflow job for this annotation

GitHub Actions / build (x64)

Non-nullable property 'PossibleParameterList' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 54 in FAFB-PowerShell-Tool/MainWindowViewModel.cs

View workflow job for this annotation

GitHub Actions / build (x64)

Non-nullable field '_selectedCommand' must contain a non-null value when exiting constructor. Consider declaring the field as nullable.

Check warning on line 54 in FAFB-PowerShell-Tool/MainWindowViewModel.cs

View workflow job for this annotation

GitHub Actions / build (x64)

Non-nullable field '_powerShellOutput' must contain a non-null value when exiting constructor. Consider declaring the field as nullable.

Check warning on line 54 in FAFB-PowerShell-Tool/MainWindowViewModel.cs

View workflow job for this annotation

GitHub Actions / build (x64)

Non-nullable field 'savedQueries' must contain a non-null value when exiting constructor. Consider declaring the field as nullable.
{
Expand Down Expand Up @@ -87,7 +94,7 @@ private async void LoadParametersAsync(Command selectedCommand)
PossibleParameterList = new ObservableCollection<string>(commandParameters.PossibleParameters);
OnPropertyChanged(nameof(PossibleParameterList));

// Update the possible properties of the ComboBoxParameterViewModels
// Update the possible properties of the ComboBoxParameterViewModels.
foreach (ComboBoxParameterViewModel comboBoxParameterViewModel in DynamicParameterCollection)
{
comboBoxParameterViewModel.PossibleParameterList = PossibleParameterList;
Expand Down Expand Up @@ -145,21 +152,6 @@ private void LoadCustomQueries()
// TODO: Write logic to load queries...
}

// ....BELOW CODE.... //

/// <summary>
/// This is the event handler for the INotifyPropertyChanged interface.
/// </summary>
public event PropertyChangedEventHandler? PropertyChanged;

/// <summary>
/// This is the method that is called when a property is changed.
/// </summary>
/// <param name="propertyName">...</param>
protected virtual void OnPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}

//This
private RelayCommand savedQueries;
Expand Down Expand Up @@ -203,4 +195,13 @@ private void PerformSavedQueries(object commandParameter)
Console.Write(ex);
}
}

/// <summary>
/// This is the method that is called when a property is changed.
/// </summary>
/// <param name="propertyName">...</param>
protected virtual void OnPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
2 changes: 0 additions & 2 deletions FAFB-PowerShell-Tool/PSSaveOptions.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using FAFB_PowerShell_Tool.PowerShell;
using System;
using System.Management.Automation.Internal;
using System.Management.Automation.Runspaces;

namespace FAFB_PowerShell_Tool;

Expand Down
1 change: 0 additions & 1 deletion FAFB-PowerShell-Tool/PowerShell/ActiveDirectoryCommands.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System.Collections.ObjectModel;
using System.Management.Automation;
using System.Management.Automation.Runspaces;
using System.Reflection.Metadata;

namespace FAFB_PowerShell_Tool.PowerShell;

Expand Down

0 comments on commit 0d81234

Please # to comment.