Browse Source
Merge pull request #9857 from workgroupengineering/features/NetAnalyzers/CA2211
feat: Enable Rule CA2211
pull/9879/head
Max Katz
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with
13 additions and
11 deletions
-
.editorconfig
-
src/Avalonia.Controls.ColorPicker/ColorPalettes/FlatColorPalette.cs
-
src/Avalonia.Controls.ColorPicker/ColorPalettes/FlatHalfColorPalette.cs
-
src/Avalonia.Controls.ColorPicker/ColorPalettes/MaterialColorPalette.cs
-
src/Avalonia.Controls.ColorPicker/ColorPalettes/MaterialHalfColorPalette.cs
-
src/Avalonia.Controls.DataGrid/DataGridCheckBoxColumn.cs
-
src/Avalonia.Controls.DataGrid/DataGridColumn.cs
-
src/Avalonia.Controls/Diagnostics/ToolTipDiagnostics.cs
|
|
|
@ -169,6 +169,8 @@ dotnet_diagnostic.CA1828.severity = warning |
|
|
|
dotnet_diagnostic.CA1829.severity = warning |
|
|
|
#CA1847: Use string.Contains(char) instead of string.Contains(string) with single characters |
|
|
|
dotnet_diagnostic.CA1847.severity = warning |
|
|
|
#CACA2211:Non-constant fields should not be visible |
|
|
|
dotnet_diagnostic.CA2211.severity = error |
|
|
|
|
|
|
|
# Wrapping preferences |
|
|
|
csharp_wrap_before_ternary_opsigns = false |
|
|
|
|
|
|
|
@ -289,8 +289,8 @@ namespace Avalonia.Controls |
|
|
|
}; |
|
|
|
|
|
|
|
// See: https://htmlcolorcodes.com/assets/downloads/flat-design-colors/flat-design-color-chart.png
|
|
|
|
protected static Color[,]? _colorChart = null; |
|
|
|
protected static object _colorChartMutex = new object(); |
|
|
|
private static Color[,]? _colorChart = null; |
|
|
|
private static readonly object _colorChartMutex = new(); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Initializes all color chart colors.
|
|
|
|
|
|
|
|
@ -10,8 +10,8 @@ namespace Avalonia.Controls |
|
|
|
/// <inheritdoc cref="FlatColorPalette"/>
|
|
|
|
public class FlatHalfColorPalette : IColorPalette |
|
|
|
{ |
|
|
|
protected static Color[,]? _colorChart = null; |
|
|
|
protected static object _colorChartMutex = new object(); |
|
|
|
private static Color[,]? _colorChart = null; |
|
|
|
private static readonly object _colorChartMutex = new(); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Initializes all color chart colors.
|
|
|
|
|
|
|
|
@ -344,8 +344,8 @@ namespace Avalonia.Controls |
|
|
|
|
|
|
|
// See: https://material.io/design/color/the-color-system.html#tools-for-picking-colors
|
|
|
|
// This is a reduced palette for uniformity
|
|
|
|
protected static Color[,]? _colorChart = null; |
|
|
|
protected static object _colorChartMutex = new object(); |
|
|
|
private static Color[,]? _colorChart = null; |
|
|
|
private static readonly object _colorChartMutex = new(); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Initializes all color chart colors.
|
|
|
|
|
|
|
|
@ -10,8 +10,8 @@ namespace Avalonia.Controls |
|
|
|
/// <inheritdoc cref="MaterialColorPalette"/>
|
|
|
|
public class MaterialHalfColorPalette : IColorPalette |
|
|
|
{ |
|
|
|
protected static Color[,]? _colorChart = null; |
|
|
|
protected static object _colorChartMutex = new object(); |
|
|
|
private static Color[,]? _colorChart = null; |
|
|
|
private static readonly object _colorChartMutex = new(); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Initializes all color chart colors.
|
|
|
|
|
|
|
|
@ -31,7 +31,7 @@ namespace Avalonia.Controls |
|
|
|
/// <summary>
|
|
|
|
/// Defines the <see cref="IsThreeState"/> property.
|
|
|
|
/// </summary>
|
|
|
|
public static StyledProperty<bool> IsThreeStateProperty = |
|
|
|
public static readonly StyledProperty<bool> IsThreeStateProperty = |
|
|
|
CheckBox.IsThreeStateProperty.AddOwner<DataGridCheckBoxColumn>(); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
@ -185,7 +185,7 @@ namespace Avalonia.Controls |
|
|
|
/// <summary>
|
|
|
|
/// Defines the <see cref="IsVisible"/> property.
|
|
|
|
/// </summary>
|
|
|
|
public static StyledProperty<bool> IsVisibleProperty = |
|
|
|
public static readonly StyledProperty<bool> IsVisibleProperty = |
|
|
|
Control.IsVisibleProperty.AddOwner<DataGridColumn>(); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
@ -8,6 +8,6 @@ |
|
|
|
/// <summary>
|
|
|
|
/// Provides access to the internal <see cref="ToolTip.ToolTipProperty"/> for use in DevTools.
|
|
|
|
/// </summary>
|
|
|
|
public static AvaloniaProperty<ToolTip?> ToolTipProperty = ToolTip.ToolTipProperty; |
|
|
|
public static readonly AvaloniaProperty<ToolTip?> ToolTipProperty = ToolTip.ToolTipProperty; |
|
|
|
} |
|
|
|
} |
|
|
|
|