Skip to content

Commit

Permalink
Remove explicit IDE1005 suppressions (PowerShell#21217)
Browse files Browse the repository at this point in the history
  • Loading branch information
xtqqczze authored Jul 15, 2024
1 parent 390a341 commit 2e93c18
Show file tree
Hide file tree
Showing 11 changed files with 0 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Licensed under the MIT License.

using System;
using System.Diagnostics.CodeAnalysis;

namespace Microsoft.Management.UI.Internal
{
Expand Down Expand Up @@ -62,14 +61,12 @@ protected FilterRule()
/// </summary>
protected void NotifyEvaluationResultInvalidated()
{
#pragma warning disable IDE1005 // IDE1005: Delegate invocation can be simplified.
var eh = this.EvaluationResultInvalidated;

if (eh != null)
{
eh(this, new EventArgs());
}
#pragma warning restore IDE1005
}

#endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Windows.Data;

Expand Down Expand Up @@ -210,14 +209,12 @@ protected override DataErrorInfoValidationResult Validate(string columnName)
/// </param>
protected void NotifySelectedValueChanged(T oldValue, T newValue)
{
#pragma warning disable IDE1005 // IDE1005: Delegate invocation can be simplified.
EventHandler<PropertyChangedEventArgs<T>> eh = this.SelectedValueChanged;

if (eh != null)
{
eh(this, new PropertyChangedEventArgs<T>(oldValue, newValue));
}
#pragma warning restore IDE1005
}

#endregion NotifySelectedValueChanged
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;

namespace Microsoft.Management.UI.Internal
Expand Down Expand Up @@ -252,14 +251,12 @@ protected void InvalidateValidationResult()
/// </param>
protected void NotifyPropertyChanged(string propertyName)
{
#pragma warning disable IDE1005 // IDE1005: Delegate invocation can be simplified.
PropertyChangedEventHandler eh = this.PropertyChanged;

if (eh != null)
{
eh(this, new PropertyChangedEventArgs(propertyName));
}
#pragma warning restore IDE1005
}

#endregion NotifyPropertyChanged
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,12 @@ public AddFilterRulePickerItem(FilterRulePanelItem filterRule)
/// </param>
protected void NotifyPropertyChanged(string propertyName)
{
#pragma warning disable IDE1005 // IDE1005: Delegate invocation can be simplified.
PropertyChangedEventHandler eh = this.PropertyChanged;

if (eh != null)
{
eh(this, new PropertyChangedEventArgs(propertyName));
}
#pragma warning restore IDE1005
}

#endregion NotifyPropertyChanged
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,11 @@ public void ClearContentTemplates()
/// </summary>
protected virtual void NotifyFilterExpressionChanged()
{
#pragma warning disable IDE1005 // IDE1005: Delegate invocation can be simplified.
EventHandler eh = this.FilterExpressionChanged;
if (eh != null)
{
eh(this, new EventArgs());
}
#pragma warning restore IDE1005
}

private void Controller_FilterExpressionChanged(object sender, EventArgs e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,13 +260,11 @@ private void UpdateFilterRulePanelItemTypes()
/// </summary>
protected virtual void NotifyFilterExpressionChanged()
{
#pragma warning disable IDE1005 // IDE1005: Delegate invocation can be simplified.
EventHandler eh = this.FilterExpressionChanged;
if (eh != null)
{
eh(this, new EventArgs());
}
#pragma warning restore IDE1005
}

#endregion Notify Filter Expression Changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,11 @@ protected void NotifyPropertyChanged(string propertyName)
{
Debug.Assert(!string.IsNullOrEmpty(propertyName), "not null");

#pragma warning disable IDE1005 // IDE1005: Delegate invocation can be simplified.

PropertyChangedEventHandler eh = this.PropertyChanged;
if (eh != null)
{
eh(this, new PropertyChangedEventArgs(propertyName));
}

#pragma warning restore IDE1005s
}

#endregion Public Methods
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,11 @@ public bool HasFilterExpression
/// </summary>
protected virtual void NotifyFilterExpressionChanged()
{
#pragma warning disable IDE1005 // IDE1005: Delegate invocation can be simplified.
EventHandler eh = this.FilterExpressionChanged;
if (eh != null)
{
eh(this, new EventArgs());
}
#pragma warning restore IDE1005s
}

#endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -550,8 +550,6 @@ internal static CommandViewModel GetCommandViewModel(ModuleViewModel module, Sho
return returnValue;
}

#pragma warning disable IDE1005 // IDE1005: Delegate invocation can be simplified.

/// <summary>
/// Called to trigger the event fired when help is needed for the command.
/// </summary>
Expand Down Expand Up @@ -627,8 +625,6 @@ private void OnNotifyPropertyChanged(string propertyName)
}
}

#pragma warning restore IDE1005

/// <summary>
/// Called when the PropertyChanged event is triggered on the SelectedParameterSet.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,13 +363,11 @@ private void EvaluateAllMandatoryParametersHaveValues()
/// <param name="propertyName">The changed property.</param>
private void OnNotifyPropertyChanged(string propertyName)
{
#pragma warning disable IDE1005 // IDE1005: Delegate invocation can be simplified.
PropertyChangedEventHandler handler = this.PropertyChanged;
if (handler != null)
{
handler(this, new PropertyChangedEventArgs(propertyName));
}
#pragma warning restore IDE1005
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,13 +262,11 @@ internal static string EvaluateTooltip(string typeName, int position, bool manda
/// <param name="propertyName">The changed property.</param>
private void OnNotifyPropertyChanged(string propertyName)
{
#pragma warning disable IDE1005 // IDE1005: Delegate invocation can be simplified.
PropertyChangedEventHandler handler = this.PropertyChanged;
if (handler != null)
{
handler(this, new PropertyChangedEventArgs(propertyName));
}
#pragma warning restore IDE1005
}
}
}

0 comments on commit 2e93c18

Please sign in to comment.