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

Commit

Permalink
Add disable pragmas
Browse files Browse the repository at this point in the history
  • Loading branch information
StrangeRanger committed Mar 28, 2024
1 parent 80850dd commit c9f2274
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion ActiveDirectoryQuerier/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ internal void ClearConsoleOutput(ConsoleViewModel consoleOutput)
}
}

#pragma warning disable S2326 // Unused parameters should be removed | This method is used as a relay command.
private async void ExecuteSelectedQueryInADInfo(object? _)
{
if (SelectedQueryInActiveDirectoryInfo is null)
Expand All @@ -276,6 +277,7 @@ private async void ExecuteSelectedQueryInADInfo(object? _)
throw new KeyNotFoundException("The selected option was not found in the dictionary.");
}
}
#pragma warning restore S2326 // Unused parameters should be removed

internal void EditQueryFromQueryStackPanel(object? queryButton)
{
Expand Down Expand Up @@ -372,7 +374,7 @@ internal void DeleteQueryFromQueryStackPanel(object? queryButton)
}
}

// TODO: Continue refactoring starting here...
#pragma warning disable S2326 // Unused parameters should be removed | This method is used as a relay command.
private void CreateNewQueryFile(object? _)
{
// Saves/creates a new save file for the queries
Expand All @@ -384,6 +386,7 @@ private void CreateNewQueryFile(object? _)
_queryManager.QueryFileSaveLocation = saveFileDialog.FileName;
}
}
#pragma warning restore S2326 // Unused parameters should be removed

private void LoadSavedQueriesFromFile()
{
Expand All @@ -405,6 +408,7 @@ private void LoadSavedQueriesFromFile()
}
}

#pragma warning disable S2326 // Unused parameters should be removed | This method is used as a relay command.
private void ImportQueryFile(object? _)
{
OpenFileDialog dialog =
Expand All @@ -423,6 +427,7 @@ private void ImportQueryFile(object? _)
LoadSavedQueriesFromFile();
}
}
#pragma warning restore S2326

private async Task InitializeActiveDirectoryCommandsAsync()
{
Expand Down Expand Up @@ -460,6 +465,7 @@ private async Task LoadCommandParametersAsync(Command? selectedCommand)
}
}

#pragma warning disable S2326 // Unused parameters should be removed | This method is used as a relay command.
internal void AddParameterComboBoxInQueryBuilder(object? _)
{
// Check if some variable is null and throw an exception if it is
Expand All @@ -477,12 +483,15 @@ internal void AddParameterComboBoxInQueryBuilder(object? _)
new ComboBoxParameterViewModel(AvailableADCommandParameters));
DynamicallyAvailableADCommandParameterValueTextBoxes.Add(new TextBoxViewModel());
}
#pragma warning restore S2326

#pragma warning disable S2326 // Unused parameters should be removed | This method is used as a relay command.
private void AddCommandComboBoxInQueryBuilder(object? _)
{
Trace.WriteLine("Not implemented yet.");
MessageBoxService.Show("Not implemented yet.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
}
#pragma warning restore S2326

private void UpdateCommandWithSelectedParameters()
{
Expand Down Expand Up @@ -536,6 +545,7 @@ private void GetCurrentQuery()
_currentQuery.PSCommandParameterValues = commandParameterValues;
}

#pragma warning disable S2326 // Unused parameters should be removed | This method is used as a relay command.
internal void RemoveParameterComboBoxInQueryBuilder(object? _)
{
if (DynamicallyAvailableADCommandParameterComboBoxes.Count != 0)
Expand All @@ -553,6 +563,7 @@ internal void RemoveParameterComboBoxInQueryBuilder(object? _)
MessageBoxImage.Warning);
}
}
#pragma warning restore S2326

internal void SaveCurrentQuery(object? commandParameter)
{
Expand Down Expand Up @@ -598,6 +609,7 @@ internal void SaveCurrentQuery(object? commandParameter)
}
}

#pragma warning disable S2326 // Unused parameters should be removed | This method is used as a relay command.
internal void ClearQueryBuilder(object? _)
{
if (SelectedCommandInQueryBuilder is null && DynamicallyAvailableADCommandParameterComboBoxes.Count == 0)
Expand Down Expand Up @@ -626,6 +638,7 @@ internal void ClearQueryBuilder(object? _)
DynamicallyAvailableADCommandParameterValueTextBoxes.Clear();
}
}
#pragma warning restore S2326

/// <remarks>
/// The use of the <c>command</c> parameter indicates that the method can be called from the Query Stack Panel.
Expand Down Expand Up @@ -694,6 +707,7 @@ private async void ExecuteQueryFromQueryStackPanelAsync(object? queryButton)
await ExecuteQueryAsync(ConsoleOutputInQueryBuilder, buttonQuery.Command);
}

#pragma warning disable S2326 // Unused parameters should be removed | This method is used as a relay command.
private void ExportConsoleOutputToFile(object? _)
{
if (ConsoleOutputInQueryBuilder.GetConsoleOutput.Length == 0)
Expand All @@ -715,6 +729,7 @@ private void ExportConsoleOutputToFile(object? _)
ConsoleOutputInQueryBuilder.ExportToTextFile(filename);
}
}
#pragma warning restore S2326

private async void OutputExecutionResultsToTextFileAsync(object? queryButton)
{
Expand Down Expand Up @@ -821,6 +836,7 @@ private void OnIsQueryEditingEnabledChanged()
}
}

#pragma warning disable S2326 // Unused parameters should be removed | This method is used as a relay command.
private void CheckBoxChecked(object? _)
{
if (IsQueryEditingEnabled)
Expand All @@ -833,6 +849,7 @@ private void CheckBoxChecked(object? _)
IsQueryEditingEnabled = false;
}
}
#pragma warning restore S2326

private OutputFormat CalculateOutputFormat()
{
Expand Down

0 comments on commit c9f2274

Please sign in to comment.