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

Commit

Permalink
Improve parameter name
Browse files Browse the repository at this point in the history
  • Loading branch information
StrangeRanger committed Mar 12, 2024
1 parent f0ea8a5 commit 896ecfe
Showing 1 changed file with 7 additions and 20 deletions.
27 changes: 7 additions & 20 deletions ActiveDirectoryQuerier/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public MainWindowViewModel()
AddCommandComboBoxRelay = new RelayCommand(AddCommandComboBox);
RemoveCommandParameterComboBoxRelay = new RelayCommand(RemoveCommandParameterComboBox);
SaveQueryRelay = new RelayCommand(SaveQuery);
EditQueryFromQueryStackPanelRelay = new RelayCommand(EditQueryFromQueryStackPane);
EditQueryFromQueryStackPanelRelay = new RelayCommand(EditQueryFromQueryStackPanel);
DeleteQueryFromQueryStackPanelRelay = new RelayCommand(DeleteQueryFromQueryStackPanel);
ExecuteQueryFromQueryStackPanelRelay = new RelayCommand(ExecuteQueryFromQueryStackPanel);
ClearConsoleOutputInQueryBuilderRelay = new RelayCommand(_ => ClearConsoleOutput(_consoleOutputInQueryBuilder));
Expand Down Expand Up @@ -237,7 +237,7 @@ private void ClearConsoleOutput(AppConsole appConsole)
}
}

private void EditQueryFromQueryStackPane(object queryButton)
private void EditQueryFromQueryStackPanel(object queryButton)
{
Query currentQuery = (Query)((Button)queryButton).Tag;

Expand Down Expand Up @@ -279,11 +279,9 @@ private void EditQueryFromQueryStackPane(object queryButton)
}
}

private async void ExecuteQueryFromQueryStackPanel(object _)
private async void ExecuteQueryFromQueryStackPanel(object queryButton)
{
var currentButton = _ as Button;

if (currentButton is null)
if (queryButton is not Button currentButton)
{
Trace.WriteLine("No button selected.");
MessageBox.Show("To execute a query, you must first select a query.",
Expand All @@ -296,17 +294,10 @@ private async void ExecuteQueryFromQueryStackPanel(object _)
Query buttonQuery = (Query)currentButton.Tag;
await ExecuteQueryCoreAsync(ConsoleOutputInQueryBuilder, buttonQuery.Command);
}

/// <summary>
/// This method deletes the button from the list and saves the changes to the file
/// </summary>
/// <param name="_">This is the Button as a generic object that is clicked when executing</param>
private void DeleteQueryFromQueryStackPanel(object _)

private void DeleteQueryFromQueryStackPanel(object queryButton)
{
// Delete a button from the custom queries list and from the file
var currentButton = _ as Button;

if (currentButton is null)
if (queryButton is not Button currentButton)
{
Trace.WriteLine("No button selected.");
MessageBox.Show("To delete a query, you must first select a query.",
Expand Down Expand Up @@ -680,10 +671,6 @@ private void SaveQuery(object commandParameter)
}
}

/// <summary>
/// This method will clear the query builder and reset the fields to their default values
/// </summary>
/// <param name="_">Object that the command is tied to</param>
private void ClearQueryBuilder(object _)
{
if (SelectedCommandFromComboBoxInQueryBuilder is null && DynamicallyAvailableADCommandParametersComboBox.Count == 0)
Expand Down

0 comments on commit 896ecfe

Please sign in to comment.