Skip to content

Commit

Permalink
fix some attributes NRT (#8924)
Browse files Browse the repository at this point in the history
  • Loading branch information
halgab authored Jun 24, 2024
1 parent fd32311 commit 6d26b95
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace System.Windows.Markup
public sealed class RuntimeNamePropertyAttribute: Attribute
{
/// <summary/>
public RuntimeNamePropertyAttribute(string name)
public RuntimeNamePropertyAttribute(string? name)
{
Name = name;
}
Expand All @@ -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
/// </summary>
public string Name { get; }
public string? Name { get; }
}
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ public sealed class ConstructorArgumentAttribute : Attribute
/// Constructor for an ConstructorArgumentAttribute
/// </summary>
/// <param name="argumentName">Name of the constructor argument that will initialize this property</param>
public ConstructorArgumentAttribute(string argumentName)
public ConstructorArgumentAttribute(string? argumentName)
{
ArgumentName = argumentName;
}

/// <summary>
/// Name of the constructor argument that will initialize this property
/// </summary>
public string ArgumentName { get; }
public string? ArgumentName { get; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public sealed class ContentWrapperAttribute : Attribute
/// type this attribute is declared on.
/// </summary>
/// <param name="contentWrapper"></param>
public ContentWrapperAttribute(Type contentWrapper)
public ContentWrapperAttribute(Type? contentWrapper)
{
ContentWrapper = contentWrapper;
}
Expand All @@ -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.
/// </summary>
public Type ContentWrapper { get; }
public Type? ContentWrapper { get; }

/// <summary>
/// Override to ensure AttributeCollection perserves all instances
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public sealed class DependsOnAttribute : Attribute
/// Constructor for DependsOnAttribute
/// </summary>
/// <param name="name">The name of the property that the property depends on</param>
public DependsOnAttribute(string name)
public DependsOnAttribute(string? name)
{
Name = name;
}
Expand All @@ -36,6 +36,6 @@ public DependsOnAttribute(string name)
/// <summary>
/// The name of the property that is declared to depend on
/// </summary>
public string Name { get; }
public string? Name { get; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public sealed class RootNamespaceAttribute : Attribute
/// RootNamespace property in a project file.
/// </summary>
/// <param name="nameSpace">The root namespace value</param>
public RootNamespaceAttribute(string nameSpace)
public RootNamespaceAttribute(string? nameSpace)
{
Namespace = nameSpace;
}
Expand All @@ -28,6 +28,6 @@ public RootNamespaceAttribute(string nameSpace)
/// The root namespace value corresponding to the value of the RootNamespace
/// property in a project file.
/// </summary>
public string Namespace { get; }
public string? Namespace { get; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ public sealed class UidPropertyAttribute : Attribute
/// Creates a new UidPropertyAttribute with the given string as
/// the property name.
/// </summary>
public UidPropertyAttribute(string name)
public UidPropertyAttribute(string? name)
{
Name = name;
}

/// <summary>
/// The name of the property that is designated to accept the x:Uid value
/// </summary>
public string Name { get; }
public string? Name { get; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
}
}

0 comments on commit 6d26b95

Please sign in to comment.