Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Management.Automation;
using System.Windows.Documents;
Expand Down Expand Up @@ -274,13 +273,11 @@ private void SetMatchesLabel()
/// <param name="propertyName">Property name.</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 IDE1005s
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Text;
using System.Windows.Documents;
using System.Windows.Media;
Expand Down Expand Up @@ -108,15 +107,10 @@ internal void BuildParagraph()
bool newHighlighted = false;

ParagraphBuilder.MoveSpanToPosition(ref currentBoldIndex, ref currentBoldSpan, i, this.boldSpans);

#pragma warning disable IDE0075 // IDE0075: Conditional expression can be simplified
newBold = currentBoldSpan == null ? false : currentBoldSpan.Value.Contains(i);
#pragma warning restore IDE0075

ParagraphBuilder.MoveSpanToPosition(ref currentHighlightedIndex, ref currentHighlightedSpan, i, this.highlightedSpans);
#pragma warning disable IDE0075 // IDE0075: Conditional expression can be simplified
newHighlighted = currentHighlightedSpan == null ? false : currentHighlightedSpan.Value.Contains(i);
#pragma warning restore IDE0075

if (newBold != currentBold || newHighlighted != currentHighlighted)
{
Expand Down Expand Up @@ -307,13 +301,11 @@ private void AddHighlight(int start, int length)
/// <param name="propertyName">Property name.</param>
private void OnNotifyPropertyChanged(string propertyName)
{
#pragma warning disable IDE1005 // IDE1005: Delegate invocation can be simplified.s
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 @@ -3,7 +3,6 @@

using System;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Controls.Primitives;
Expand Down Expand Up @@ -80,7 +79,6 @@ protected override void OnClosed(EventArgs e)
}
}

[SuppressMessage("Performance", "CA1822: Mark members as static", Justification = "Potential breaking change")]
private void SetFocus(UIElement element)
{
if (element.Focusable)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ public bool IsInEditMode
{
get
{
#pragma warning disable IDE0075 // IDE0075: Conditional expression can be simplified
return (this.renameButton != null) ? this.renameButton.IsChecked.Value : false;
#pragma warning restore IDE0075
}
}

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

namespace Microsoft.Management.UI.Internal
{
Expand Down Expand Up @@ -98,8 +97,6 @@ public Exception OperationError
#endregion IAsyncProgress

#region Private Methods

#pragma warning disable IDE1005 // IDE1005: Delegate invocation can be simplified.
private void OnCollectionChanged(NotifyCollectionChangedEventArgs args)
{
NotifyCollectionChangedEventHandler eh = this.CollectionChanged;
Expand All @@ -120,8 +117,6 @@ private void OnPropertyChanged(PropertyChangedEventArgs args)
}
}

#pragma warning restore IDE1005

// forward CollectionChanged events from the base list to our listeners
private void HandleCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
Expand Down Expand Up @@ -203,7 +202,6 @@ private double GetNewWidth(ResizeGripLocation location, double horzDelta)
return this.GetConstrainedValue(newWidth, this.MaxWidth, this.MinWidth);
}

[SuppressMessage("Performance", "CA1822: Mark members as static", Justification = "Potential breaking change")]
private double GetHorizontalDelta(ResizeGripLocation location, double horzDelta)
{
double realDelta;
Expand All @@ -221,7 +219,6 @@ private double GetHorizontalDelta(ResizeGripLocation location, double horzDelta)
return realDelta;
}

[SuppressMessage("Performance", "CA1822: Mark members as static", Justification = "Potential breaking change")]
private double GetConstrainedValue(double value, double max, double min)
{
return Math.Min(max, Math.Max(value, min));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Reflection;

Expand Down Expand Up @@ -197,7 +196,6 @@ public override string GetErrorMessageForInvalidValue(string value, Type typeToP

#region Helpers

[SuppressMessage("Performance", "CA1822: Mark members as static", Justification = "Potential breaking change")]
private bool TryGetGenericParameterForComparableValueFilterRule(FilterRule rule, out Type genericParameter)
{
genericParameter = null;
Expand All @@ -219,7 +217,6 @@ private bool TryGetGenericParameterForComparableValueFilterRule(FilterRule rule,
return true;
}

[SuppressMessage("Performance", "CA1822: Mark members as static", Justification = "Potential breaking change")]
private object GetValueFromValidatingValue(FilterRule rule, string propertyName)
{
Debug.Assert(rule != null && !string.IsNullOrEmpty(propertyName), "rule and propertyname are not null");
Expand All @@ -239,7 +236,6 @@ private object GetValueFromValidatingValue(FilterRule rule, string propertyName)
return property.GetValue(validatingValue, null);
}

[SuppressMessage("Performance", "CA1822: Mark members as static", Justification = "Potential breaking change")]
private void SetValueOnValidatingValue(FilterRule rule, string propertyName, object value)
{
Debug.Assert(rule != null && !string.IsNullOrEmpty(propertyName), "rule and propertyname are not null");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;

namespace Microsoft.Management.UI.Internal
{
Expand Down Expand Up @@ -174,8 +173,6 @@ public void RemoveFilterExpressionProvider(IFilterExpressionProvider provider)

#region NotifyPropertyChanged

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

/// <summary>
/// Notifies listeners that a property has changed.
/// </summary>
Expand Down Expand Up @@ -217,8 +214,6 @@ protected virtual void NotifyFilterExpressionChanged()
}
}

#pragma warning restore IDE1005

private void FilterProvider_FilterExpressionChanged(object sender, EventArgs e)
{
// Update HasFilterExpression \\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

using System;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;

namespace Microsoft.Management.UI.Internal
Expand Down Expand Up @@ -191,7 +190,6 @@ private bool TryGetCastValue(object rawValue, out T castValue)
}
}

[SuppressMessage("Performance", "CA1822: Mark members as static", Justification = "Potential breaking change")]
private bool TryGetEnumValue(object rawValue, out T castValue)
{
Debug.Assert(rawValue != null, "rawValue not null");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Windows.Controls;

namespace Microsoft.Management.UI.Internal
Expand Down Expand Up @@ -50,11 +49,9 @@ public ObservableCollection<AddFilterRulePickerItem> ColumnFilterRules

partial void OnOkAddFilterRulesCanExecuteImplementation(System.Windows.Input.CanExecuteRoutedEventArgs e)
{
#pragma warning disable IDE0075 // IDE0075: Conditional expression can be simplified
e.CanExecute = (this.AddFilterRulesCommand != null)
? CommandHelper.CanExecuteCommand(this.AddFilterRulesCommand, null, this.AddFilterRulesCommandTarget)
: false;
#pragma warning restore IDE0075
}

partial void OnOkAddFilterRulesExecutedImplementation(System.Windows.Input.ExecutedRoutedEventArgs e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Text;
using System.Windows.Data;
Expand Down Expand Up @@ -70,7 +69,6 @@ public object ConvertBack(object value, Type targetType, object parameter, Syste

#region Helpers

[SuppressMessage("Performance", "CA1822: Mark members as static", Justification = "Potential breaking change")]
private bool IsOfTypeValidatingValue(object value)
{
Debug.Assert(value != null, "not null");
Expand All @@ -94,7 +92,6 @@ private Type GetGenericParameter(object value, CultureInfo culture)
return value.GetType().GetGenericArguments()[0];
}

[SuppressMessage("Performance", "CA1822: Mark members as static", Justification = "Potential breaking change")]
private object GetBackgroundTextForType(Type inputType)
{
if (typeof(DateTime) == inputType)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using System.Collections.Specialized;
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Text;
using System.Windows;
Expand Down Expand Up @@ -402,14 +401,12 @@ private static void InnerList_OnViewChanged(DependencyObject obj, DependencyProp
/// <returns>The exception to be thrown when using Items.</returns>
private static NotSupportedException GetItemsException()
{
#pragma warning disable IDE1005 // IDE1005: Delegate invocation can be simplified.
return new NotSupportedException(
string.Format(
CultureInfo.InvariantCulture,
InvariantResources.NotSupportAddingToItems,
nameof(InnerList),
ItemsControl.ItemsSourceProperty.Name));
#pragma warning restore IDE1005s
}
#endregion static private methods

Expand Down Expand Up @@ -608,7 +605,6 @@ private string GetClipboardTextLineForSelectedItem(object value)
return entryText.ToString();
}

[SuppressMessage("Performance", "CA1822: Mark members as static", Justification = "Potential breaking change")]
private void SetClipboardWithSelectedItemsText(string text)
{
if (string.IsNullOrEmpty(text))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Management.Automation;

namespace Microsoft.Management.UI.Internal
Expand Down Expand Up @@ -89,7 +88,6 @@ private void GetPropertyValues(string propertyName, object a, object b, out obje
}
}

[SuppressMessage("Performance", "CA1822: Mark members as static", Justification = "Potential breaking change")]
private int CompareData(object firstValue, object secondValue, StringComparison stringComparison)
{
// If both values are null, do nothing; otherwise, if one is null promote the other \\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System;
using System.ComponentModel;
using System.Data;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;

namespace Microsoft.Management.UI.Internal
Expand Down Expand Up @@ -111,7 +110,6 @@ private PropertyDescriptor GetPropertyDescriptor(string propertyName, object val
return descriptor;
}

[SuppressMessage("Performance", "CA1822: Mark members as static", Justification = "Potential breaking change")]
private bool TryGetPropertyValueInternal(PropertyDescriptor descriptor, object value, out object propertyValue)
{
propertyValue = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.Collections;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
using System.Windows;
using System.Windows.Controls;
Expand Down Expand Up @@ -309,7 +308,6 @@ partial void OnClearFilterExecutedImplementation(ExecutedRoutedEventArgs e)

#region View Manager Callbacks

[SuppressMessage("Performance", "CA1822: Mark members as static", Justification = "Potential breaking change")]
partial void OnSaveViewCanExecuteImplementation(CanExecuteRoutedEventArgs e)
{
string viewName = (string)e.Parameter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Management.Automation;
using System.Windows;
Expand Down Expand Up @@ -345,7 +344,6 @@ private void CheckBox_Click(object sender, RoutedEventArgs e)
/// Creates a RowDefinition for MainGrid.
/// </summary>
/// <returns>Return a RowDefinition object.</returns>
[SuppressMessage("Performance", "CA1822: Mark members as static", Justification = "Potential breaking change")]
private RowDefinition CreateNewRow()
{
RowDefinition row = new RowDefinition();
Expand Down Expand Up @@ -384,7 +382,6 @@ private void CreateAndAddLabel(ParameterViewModel parameterViewModel, int rowNum
/// <param name="parameterViewModel">DataContext object.</param>
/// <param name="rowNumber">Row number.</param>
/// <returns>Return a Label control.</returns>
[SuppressMessage("Performance", "CA1822: Mark members as static", Justification = "Potential breaking change")]
private Label CreateLabel(ParameterViewModel parameterViewModel, int rowNumber)
{
Label label = new Label();
Expand Down
Loading