Skip to content

Commit 38c29bc

Browse files
authored
[NRT] Annotate all XAML attributes for NRT (#8676)
* Annotate all XAML attributes for NRT * update tests
1 parent 2495266 commit 38c29bc

29 files changed

+52
-111
lines changed

src/Microsoft.DotNet.Wpf/src/Shared/MS/Internal/FriendAccessAllowedAttribute.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
#nullable disable
6-
75
// Description: Implementation of a FriendAccessAllowedAttribute attribute that is used to mark internal metadata
86
// that is allowed to be accessed from friend assemblies.
97

src/Microsoft.DotNet.Wpf/src/Shared/System/Windows/Markup/RuntimeIdentifierPropertyAttribute.cs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5+
#if !SYSTEM_XAML
56
#nullable disable
7+
#pragma warning disable CS8632
8+
#endif
69

710
// Description:
811
// This attribute is placed on a class to identify the property that will
@@ -34,23 +37,15 @@ public sealed class RuntimeNamePropertyAttribute: Attribute
3437
/// <summary/>
3538
public RuntimeNamePropertyAttribute(string name)
3639
{
37-
_name = name;
40+
Name = name;
3841
}
3942

4043
/// <summary>
4144
/// The Name of the property in the class that will contain the ID of
4245
/// the class, this property needs to be of type string and have
4346
/// both get and set access
4447
/// </summary>
45-
public string Name
46-
{
47-
get
48-
{
49-
return _name;
50-
}
51-
}
52-
53-
private string _name;
48+
public string Name { get; }
5449
}
5550
#endif
5651

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class AcceptedMarkupExtensionExpressionTypeAttribute: Attribute
1313
public Type Type { get; set; }
1414

1515
public AcceptedMarkupExtensionExpressionTypeAttribute(Type type)
16-
{
16+
{
1717
Type = type;
1818
}
1919
}

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
#nullable disable
6-
75
using System.Runtime.CompilerServices;
86

97
namespace System.Windows.Markup

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
#nullable disable
6-
75
using System.Runtime.CompilerServices;
86

97
namespace System.Windows.Markup

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
#nullable disable
6-
75
using System.Runtime.CompilerServices;
86

97
namespace System.Windows.Markup
@@ -30,14 +28,14 @@ public ContentPropertyAttribute()
3028
/// of XAML content with property of the given name.
3129
/// </summary>
3230
/// <param name="name">The property to associate to direct XAML content</param>
33-
public ContentPropertyAttribute(string name)
31+
public ContentPropertyAttribute(string? name)
3432
{
3533
Name = name;
3634
}
3735

3836
/// <summary>
3937
/// The name of the property that is associated with direct XAML content
4038
/// </summary>
41-
public string Name { get; }
39+
public string? Name { get; }
4240
}
4341
}

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
#nullable disable
6-
75
using System.Runtime.CompilerServices;
86

97
namespace System.Windows.Markup
@@ -42,7 +40,7 @@ public ContentWrapperAttribute(Type contentWrapper)
4240
/// Overrides Object.Equals to implement correct equality semantics for this
4341
/// attribute.
4442
/// </summary>
45-
public override bool Equals(object obj)
43+
public override bool Equals(object? obj)
4644
{
4745
return
4846
obj is ContentWrapperAttribute other &&

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
#nullable disable
6-
75
using System.Runtime.CompilerServices;
86

97
namespace System.Windows.Markup

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
#nullable disable
6-
75
using System.Runtime.CompilerServices;
86

97
namespace System.Windows.Markup

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
#nullable disable
6-
75
namespace System.Windows.Markup
86
{
97
/// <summary>

0 commit comments

Comments
 (0)