Skip to content

Commit 7d47015

Browse files
Handle new warnings
1 parent 06c8ef8 commit 7d47015

File tree

5 files changed

+7
-26
lines changed

5 files changed

+7
-26
lines changed

eng/WpfArcadeSdk/tools/CodeAnalysis/CodeAnalysis.src.globalconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ dotnet_diagnostic.CA1820.severity = none
297297
dotnet_diagnostic.CA1821.severity = none # TODO: warning
298298

299299
# CA1822: Mark members as static
300-
dotnet_diagnostic.CA1822.severity = warning
300+
dotnet_diagnostic.CA1822.severity = none # TODO: warning
301301
dotnet_code_quality.CA1822.api_surface = private, internal
302302

303303
# CA1823: Avoid unused private fields
@@ -388,7 +388,7 @@ dotnet_diagnostic.CA1850.severity = warning
388388
dotnet_diagnostic.CA1851.severity = suggestion
389389

390390
# CA1852: Seal internal types
391-
dotnet_diagnostic.CA1852.severity = warning
391+
dotnet_diagnostic.CA1852.severity = none # TODO: warning
392392

393393
# CA1853: Unnecessary call to 'Dictionary.ContainsKey(key)'
394394
dotnet_diagnostic.CA1853.severity = warning

src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Windows/Markup/StaticExtensionConverter.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818

1919
namespace System.Windows.Markup
2020
{
21+
#pragma warning disable CA1812 // This type is used inside a TypeConverterAttribute which creates instances of this class.
2122
class StaticExtensionConverter : TypeConverter
23+
#pragma warning restore CA1812
2224
{
2325
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
2426
{

src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Windows/Markup/TypeExtensionConverter.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818

1919
namespace System.Windows.Markup
2020
{
21+
#pragma warning disable CA1812 // This type is used inside a TypeConverterAttribute which creates instances of this class.
2122
class TypeExtensionConverter : TypeConverter
23+
#pragma warning restore CA1812
2224
{
2325
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
2426
{

src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/Schema/XamlTypeInvoker.cs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -346,28 +346,5 @@ private static bool EnsureConstructorDelegate(XamlTypeInvoker type)
346346
return true;
347347
}
348348
}
349-
350-
private class UnknownTypeInvoker : XamlTypeInvoker
351-
{
352-
public override void AddToCollection(object instance, object item)
353-
{
354-
throw new NotSupportedException(SR.NotSupportedOnUnknownType);
355-
}
356-
357-
public override void AddToDictionary(object instance, object key, object item)
358-
{
359-
throw new NotSupportedException(SR.NotSupportedOnUnknownType);
360-
}
361-
362-
public override object CreateInstance(object[] arguments)
363-
{
364-
throw new NotSupportedException(SR.NotSupportedOnUnknownType);
365-
}
366-
367-
public override IEnumerator GetItems(object instance)
368-
{
369-
throw new NotSupportedException(SR.NotSupportedOnUnknownType);
370-
}
371-
}
372349
}
373350
}

src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/XamlType.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1511,7 +1511,7 @@ private static string GetTypeName(Type type)
15111511
// save the subscript
15121512
string subscript;
15131513
typeName = GenericTypeNameScanner.StripSubscript(typeName, out subscript);
1514-
typeName = typeName.Substring(0, index) + subscript;
1514+
typeName = string.Concat(typeName.AsSpan(0, index), subscript);
15151515
}
15161516
// if nested, add the containing name
15171517
if (type.IsNested)

0 commit comments

Comments
 (0)