From 0d812348adc4a0a19f16cafb8c036ec89e1806a1 Mon Sep 17 00:00:00 2001 From: Hunter T Date: Thu, 25 Jan 2024 11:33:40 -0800 Subject: [PATCH] Update comments, remove unused usings, etc. --- .../ComboBoxParameterViewModel.cs | 12 +++---- FAFB-PowerShell-Tool/MainWindowViewModel.cs | 35 ++++++++++--------- FAFB-PowerShell-Tool/PSSaveOptions.cs | 2 -- .../PowerShell/ActiveDirectoryCommands.cs | 1 - 4 files changed, 24 insertions(+), 26 deletions(-) diff --git a/FAFB-PowerShell-Tool/ComboBoxParameterViewModel.cs b/FAFB-PowerShell-Tool/ComboBoxParameterViewModel.cs index 5edf9cf..541f66a 100644 --- a/FAFB-PowerShell-Tool/ComboBoxParameterViewModel.cs +++ b/FAFB-PowerShell-Tool/ComboBoxParameterViewModel.cs @@ -1,6 +1,5 @@ using System.Collections.ObjectModel; using System.ComponentModel; -using System.Windows.Controls; namespace FAFB_PowerShell_Tool; @@ -9,9 +8,7 @@ namespace FAFB_PowerShell_Tool; /// public class ComboBoxParameterViewModel : INotifyPropertyChanged { - /// - /// This is the event handler for the INotifyPropertyChanged interface. - /// + public event PropertyChangedEventHandler? PropertyChanged; private ObservableCollection _possibleParameterList; @@ -28,7 +25,10 @@ public ObservableCollection PossibleParameterList } } - // Constructor + /// + /// Class constructor. + /// + /// List of possible parameters for the corresponding command. public ComboBoxParameterViewModel(ObservableCollection possibleParameterList) { PossibleParameterList = possibleParameterList; @@ -37,7 +37,7 @@ public ComboBoxParameterViewModel(ObservableCollection possibleParameter /// /// This is the method that is called when a property is changed. /// - /// ... + /// Property that changed. protected virtual void OnPropertyChanged(string propertyName) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); diff --git a/FAFB-PowerShell-Tool/MainWindowViewModel.cs b/FAFB-PowerShell-Tool/MainWindowViewModel.cs index 5a314f1..adf26b5 100644 --- a/FAFB-PowerShell-Tool/MainWindowViewModel.cs +++ b/FAFB-PowerShell-Tool/MainWindowViewModel.cs @@ -9,8 +9,15 @@ namespace FAFB_PowerShell_Tool; +/// +/// Primary view model for the MainWindow. +/// public class MainWindowViewModel : INotifyPropertyChanged { + /// + /// This is the event handler for the INotifyPropertyChanged interface. + /// + public event PropertyChangedEventHandler? PropertyChanged; public ObservableCollection ActiveDirectoryCommandList { get; private set; } public ObservableCollection PossibleParameterList { get; private set; } public ObservableCollection DynamicParameterCollection { get; private set; } @@ -42,7 +49,7 @@ public string PowerShellOutput } /// - /// Constructor... + /// Class constructor. /// public MainWindowViewModel() { @@ -87,7 +94,7 @@ private async void LoadParametersAsync(Command selectedCommand) PossibleParameterList = new ObservableCollection(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; @@ -145,21 +152,6 @@ private void LoadCustomQueries() // TODO: Write logic to load queries... } - // ....BELOW CODE.... // - - /// - /// This is the event handler for the INotifyPropertyChanged interface. - /// - public event PropertyChangedEventHandler? PropertyChanged; - - /// - /// This is the method that is called when a property is changed. - /// - /// ... - protected virtual void OnPropertyChanged(string propertyName) - { - PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); - } //This private RelayCommand savedQueries; @@ -203,4 +195,13 @@ private void PerformSavedQueries(object commandParameter) Console.Write(ex); } } + + /// + /// This is the method that is called when a property is changed. + /// + /// ... + protected virtual void OnPropertyChanged(string propertyName) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } } diff --git a/FAFB-PowerShell-Tool/PSSaveOptions.cs b/FAFB-PowerShell-Tool/PSSaveOptions.cs index 3ec1b60..78b8b2f 100644 --- a/FAFB-PowerShell-Tool/PSSaveOptions.cs +++ b/FAFB-PowerShell-Tool/PSSaveOptions.cs @@ -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; diff --git a/FAFB-PowerShell-Tool/PowerShell/ActiveDirectoryCommands.cs b/FAFB-PowerShell-Tool/PowerShell/ActiveDirectoryCommands.cs index d79d438..309826f 100644 --- a/FAFB-PowerShell-Tool/PowerShell/ActiveDirectoryCommands.cs +++ b/FAFB-PowerShell-Tool/PowerShell/ActiveDirectoryCommands.cs @@ -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;