Browse Source
Merge pull request #9593 from workgroupengineering/features/NetAnalyzers/CA1826_to_CA1829
feat: Enable Rules from 1826 to 1829
pull/9596/head
Max Katz
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
10 additions and
2 deletions
-
.editorconfig
-
src/Avalonia.Controls/Selection/SelectionNodeBase.cs
|
|
|
@ -145,6 +145,14 @@ dotnet_diagnostic.CA1820.severity = warning |
|
|
|
dotnet_diagnostic.CA1821.severity = warning |
|
|
|
# CA1825: Avoid zero-length array allocations |
|
|
|
dotnet_diagnostic.CA1825.severity = warning |
|
|
|
# CA1826: Use property instead of Linq Enumerable method |
|
|
|
dotnet_diagnostic.CA1826.severity = suggestion |
|
|
|
# CA1827: Do not use Count/LongCount when Any can be used |
|
|
|
dotnet_diagnostic.CA1827.severity = warning |
|
|
|
# CA1828: Do not use CountAsync/LongCountAsync when AnyAsync can be used |
|
|
|
dotnet_diagnostic.CA1828.severity = warning |
|
|
|
# CA1829: Use Length/Count property instead of Enumerable.Count method |
|
|
|
dotnet_diagnostic.CA1829.severity = warning |
|
|
|
#CA1847: Use string.Contains(char) instead of string.Contains(string) with single characters |
|
|
|
dotnet_diagnostic.CA1847.severity = warning |
|
|
|
|
|
|
|
|
|
|
|
@ -290,12 +290,12 @@ namespace Avalonia.Controls.Selection |
|
|
|
// so bail.
|
|
|
|
//
|
|
|
|
// See unit test Handles_Selection_Made_In_CollectionChanged for more details.
|
|
|
|
if (ItemsView is object && |
|
|
|
if (ItemsView is not null && |
|
|
|
RangesEnabled && |
|
|
|
Ranges.Count > 0 && |
|
|
|
e.Action == NotifyCollectionChangedAction.Add) |
|
|
|
{ |
|
|
|
var lastIndex = Ranges.Last().End; |
|
|
|
var lastIndex = Ranges[Ranges.Count - 1].End; |
|
|
|
|
|
|
|
if (e.NewStartingIndex <= lastIndex) |
|
|
|
{ |
|
|
|
|