Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove explicit IDE1005 suppressions #21217

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
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
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
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
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
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
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
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
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
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
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
}
}
}