From 6d26b95c22b59c1ba61da75c44cb829b9b181626 Mon Sep 17 00:00:00 2001 From: halgab <24685886+halgab@users.noreply.github.com> Date: Mon, 24 Jun 2024 13:34:07 +0200 Subject: [PATCH] fix some attributes NRT (#8924) --- .../Windows/Markup/RuntimeIdentifierPropertyAttribute.cs | 4 ++-- .../AcceptedMarkupExtensionExpressionTypeAttribute.cs | 6 ++---- .../System/Windows/Markup/ConstructorArgumentAttribute.cs | 4 ++-- .../System/Windows/Markup/ContentWrapperAttribute.cs | 4 ++-- .../System.Xaml/System/Windows/Markup/DependsOnAttribute.cs | 4 ++-- .../System/Windows/Markup/DictionaryKeyPropertyAttribute.cs | 4 ++-- .../System/Windows/Markup/NameScopePropertyAttribute.cs | 6 +++--- .../System/Windows/Markup/RootNamespaceAttribute.cs | 4 ++-- .../System/Windows/Markup/UidPropertyAttribute.cs | 4 ++-- .../Windows/Markup/XamlSetMarkupExtensionAttribute.cs | 4 ++-- .../System/Windows/Markup/XamlSetTypeConverterAttribute.cs | 4 ++-- 11 files changed, 23 insertions(+), 25 deletions(-) diff --git a/src/Microsoft.DotNet.Wpf/src/Shared/System/Windows/Markup/RuntimeIdentifierPropertyAttribute.cs b/src/Microsoft.DotNet.Wpf/src/Shared/System/Windows/Markup/RuntimeIdentifierPropertyAttribute.cs index d65f78a6aee..92c3447394b 100644 --- a/src/Microsoft.DotNet.Wpf/src/Shared/System/Windows/Markup/RuntimeIdentifierPropertyAttribute.cs +++ b/src/Microsoft.DotNet.Wpf/src/Shared/System/Windows/Markup/RuntimeIdentifierPropertyAttribute.cs @@ -35,7 +35,7 @@ namespace System.Windows.Markup public sealed class RuntimeNamePropertyAttribute: Attribute { /// - public RuntimeNamePropertyAttribute(string name) + public RuntimeNamePropertyAttribute(string? name) { Name = name; } @@ -45,7 +45,7 @@ public RuntimeNamePropertyAttribute(string name) /// the class, this property needs to be of type string and have /// both get and set access /// - public string Name { get; } + public string? Name { get; } } #endif diff --git a/src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Windows/Markup/AcceptedMarkupExtensionExpressionTypeAttribute.cs b/src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Windows/Markup/AcceptedMarkupExtensionExpressionTypeAttribute.cs index d0f6c2f84b8..4c6ad703eab 100644 --- a/src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Windows/Markup/AcceptedMarkupExtensionExpressionTypeAttribute.cs +++ b/src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Windows/Markup/AcceptedMarkupExtensionExpressionTypeAttribute.cs @@ -2,17 +2,15 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#nullable disable - namespace System.Windows.Markup { [Obsolete("This is not used by the XAML parser. Please look at XamlSetMarkupExtensionAttribute.")] [AttributeUsage(AttributeTargets.Class, AllowMultiple=true, Inherited=true)] public class AcceptedMarkupExtensionExpressionTypeAttribute: Attribute { - public Type Type { get; set; } + public Type? Type { get; set; } - public AcceptedMarkupExtensionExpressionTypeAttribute(Type type) + public AcceptedMarkupExtensionExpressionTypeAttribute(Type? type) { Type = type; } diff --git a/src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Windows/Markup/ConstructorArgumentAttribute.cs b/src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Windows/Markup/ConstructorArgumentAttribute.cs index 16bfa7df788..110d07ed4f1 100644 --- a/src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Windows/Markup/ConstructorArgumentAttribute.cs +++ b/src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Windows/Markup/ConstructorArgumentAttribute.cs @@ -19,7 +19,7 @@ public sealed class ConstructorArgumentAttribute : Attribute /// Constructor for an ConstructorArgumentAttribute /// /// Name of the constructor argument that will initialize this property - public ConstructorArgumentAttribute(string argumentName) + public ConstructorArgumentAttribute(string? argumentName) { ArgumentName = argumentName; } @@ -27,6 +27,6 @@ public ConstructorArgumentAttribute(string argumentName) /// /// Name of the constructor argument that will initialize this property /// - public string ArgumentName { get; } + public string? ArgumentName { get; } } } diff --git a/src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Windows/Markup/ContentWrapperAttribute.cs b/src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Windows/Markup/ContentWrapperAttribute.cs index 5482c209626..8cb17decf1c 100644 --- a/src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Windows/Markup/ContentWrapperAttribute.cs +++ b/src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Windows/Markup/ContentWrapperAttribute.cs @@ -20,7 +20,7 @@ public sealed class ContentWrapperAttribute : Attribute /// type this attribute is declared on. /// /// - public ContentWrapperAttribute(Type contentWrapper) + public ContentWrapperAttribute(Type? contentWrapper) { ContentWrapper = contentWrapper; } @@ -29,7 +29,7 @@ public ContentWrapperAttribute(Type contentWrapper) /// The type that is declared as a content wrapper for the collection type /// this attribute is declared on. /// - public Type ContentWrapper { get; } + public Type? ContentWrapper { get; } /// /// Override to ensure AttributeCollection perserves all instances diff --git a/src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Windows/Markup/DependsOnAttribute.cs b/src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Windows/Markup/DependsOnAttribute.cs index e7ad948b8a5..2ad392826f8 100644 --- a/src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Windows/Markup/DependsOnAttribute.cs +++ b/src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Windows/Markup/DependsOnAttribute.cs @@ -23,7 +23,7 @@ public sealed class DependsOnAttribute : Attribute /// Constructor for DependsOnAttribute /// /// The name of the property that the property depends on - public DependsOnAttribute(string name) + public DependsOnAttribute(string? name) { Name = name; } @@ -36,6 +36,6 @@ public DependsOnAttribute(string name) /// /// The name of the property that is declared to depend on /// - public string Name { get; } + public string? Name { get; } } } diff --git a/src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Windows/Markup/DictionaryKeyPropertyAttribute.cs b/src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Windows/Markup/DictionaryKeyPropertyAttribute.cs index 7fd216cef67..17f10facca7 100644 --- a/src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Windows/Markup/DictionaryKeyPropertyAttribute.cs +++ b/src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Windows/Markup/DictionaryKeyPropertyAttribute.cs @@ -10,11 +10,11 @@ namespace System.Windows.Markup [TypeForwardedFrom("WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35")] public sealed class DictionaryKeyPropertyAttribute : Attribute { - public DictionaryKeyPropertyAttribute(string name) + public DictionaryKeyPropertyAttribute(string? name) { Name = name; } - public string Name { get; } + public string? Name { get; } } } diff --git a/src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Windows/Markup/NameScopePropertyAttribute.cs b/src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Windows/Markup/NameScopePropertyAttribute.cs index 6b9d8e18017..d8fbca69361 100644 --- a/src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Windows/Markup/NameScopePropertyAttribute.cs +++ b/src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Windows/Markup/NameScopePropertyAttribute.cs @@ -10,17 +10,17 @@ namespace System.Windows.Markup [TypeForwardedFrom("WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35")] public sealed class NameScopePropertyAttribute : Attribute { - public NameScopePropertyAttribute(string name) + public NameScopePropertyAttribute(string? name) { Name = name; } - public NameScopePropertyAttribute(string name, Type? type) : this(name) + public NameScopePropertyAttribute(string? name, Type? type) : this(name) { Type = type; } - public string Name { get; } + public string? Name { get; } public Type? Type { get; } } } diff --git a/src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Windows/Markup/RootNamespaceAttribute.cs b/src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Windows/Markup/RootNamespaceAttribute.cs index 02f41706264..f7f1f0e69cb 100644 --- a/src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Windows/Markup/RootNamespaceAttribute.cs +++ b/src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Windows/Markup/RootNamespaceAttribute.cs @@ -19,7 +19,7 @@ public sealed class RootNamespaceAttribute : Attribute /// RootNamespace property in a project file. /// /// The root namespace value - public RootNamespaceAttribute(string nameSpace) + public RootNamespaceAttribute(string? nameSpace) { Namespace = nameSpace; } @@ -28,6 +28,6 @@ public RootNamespaceAttribute(string nameSpace) /// The root namespace value corresponding to the value of the RootNamespace /// property in a project file. /// - public string Namespace { get; } + public string? Namespace { get; } } } diff --git a/src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Windows/Markup/UidPropertyAttribute.cs b/src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Windows/Markup/UidPropertyAttribute.cs index 1fcc2ef0f6a..187d205ef44 100644 --- a/src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Windows/Markup/UidPropertyAttribute.cs +++ b/src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Windows/Markup/UidPropertyAttribute.cs @@ -27,7 +27,7 @@ public sealed class UidPropertyAttribute : Attribute /// Creates a new UidPropertyAttribute with the given string as /// the property name. /// - public UidPropertyAttribute(string name) + public UidPropertyAttribute(string? name) { Name = name; } @@ -35,6 +35,6 @@ public UidPropertyAttribute(string name) /// /// The name of the property that is designated to accept the x:Uid value /// - public string Name { get; } + public string? Name { get; } } } diff --git a/src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Windows/Markup/XamlSetMarkupExtensionAttribute.cs b/src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Windows/Markup/XamlSetMarkupExtensionAttribute.cs index 877eab81bd9..79a92d2478d 100644 --- a/src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Windows/Markup/XamlSetMarkupExtensionAttribute.cs +++ b/src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Windows/Markup/XamlSetMarkupExtensionAttribute.cs @@ -7,11 +7,11 @@ namespace System.Windows.Markup [AttributeUsage(AttributeTargets.Class, Inherited=true, AllowMultiple=false)] public sealed class XamlSetMarkupExtensionAttribute : Attribute { - public XamlSetMarkupExtensionAttribute(string xamlSetMarkupExtensionHandler) + public XamlSetMarkupExtensionAttribute(string? xamlSetMarkupExtensionHandler) { XamlSetMarkupExtensionHandler = xamlSetMarkupExtensionHandler; } - public string XamlSetMarkupExtensionHandler { get; } + public string? XamlSetMarkupExtensionHandler { get; } } } diff --git a/src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Windows/Markup/XamlSetTypeConverterAttribute.cs b/src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Windows/Markup/XamlSetTypeConverterAttribute.cs index 4da1de3254d..74a88f06020 100644 --- a/src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Windows/Markup/XamlSetTypeConverterAttribute.cs +++ b/src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Windows/Markup/XamlSetTypeConverterAttribute.cs @@ -7,11 +7,11 @@ namespace System.Windows.Markup [AttributeUsage(AttributeTargets.Class, Inherited = true, AllowMultiple = false)] public sealed class XamlSetTypeConverterAttribute : Attribute { - public XamlSetTypeConverterAttribute(string xamlSetTypeConverterHandler) + public XamlSetTypeConverterAttribute(string? xamlSetTypeConverterHandler) { XamlSetTypeConverterHandler = xamlSetTypeConverterHandler; } - public string XamlSetTypeConverterHandler { get; } + public string? XamlSetTypeConverterHandler { get; } } }