Browse Source
Merge pull request #10169 from DmitryZhelnin/10119-cleanup-attributes
Cleanup attributes
pull/10176/head
Max Katz
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with
39 additions and
25 deletions
-
.editorconfig
-
src/Avalonia.Base/Metadata/AmbientAttribute.cs
-
src/Avalonia.Base/Metadata/ContentAttribute.cs
-
src/Avalonia.Base/Metadata/DataTypeAttribute.cs
-
src/Avalonia.Base/Metadata/DependsOnAttribute.cs
-
src/Avalonia.Base/Metadata/NotClientImplementableAttribute.cs
-
src/Avalonia.Base/Metadata/TemplateContent.cs
-
src/Avalonia.Base/Metadata/TrimSurroundingWhitespaceAttribute.cs
-
src/Avalonia.Base/Metadata/UnstableAttribute.cs
-
src/Avalonia.Base/Metadata/UsableDuringInitializationAttribute.cs
-
src/Avalonia.Base/Metadata/WhitespaceSignificantCollectionAttribute.cs
-
src/Avalonia.Base/Metadata/XmlnsDefinitionAttribute.cs
-
src/Avalonia.Base/Rendering/Composition/Expressions/Expression.cs
-
src/Avalonia.Controls/Platform/ExportAvaloniaModuleAttribute.cs
-
src/Avalonia.Controls/ResolveByNameAttribute.cs
-
src/Avalonia.OpenGL/GlEntryPointAttribute.cs
-
src/Avalonia.Remote.Protocol/AvaloniaRemoteMessageGuidAttribute.cs
-
src/Markup/Avalonia.Markup.Xaml/XamlTypes.cs
-
src/Shared/ModuleInitializer.cs
-
src/Shared/SourceGeneratorAttributes.cs
|
|
|
@ -145,10 +145,14 @@ dotnet_diagnostic.CS1591.severity = suggestion |
|
|
|
|
|
|
|
# CS0162: Remove unreachable code |
|
|
|
dotnet_diagnostic.CS0162.severity = error |
|
|
|
# CA1018: Mark attributes with AttributeUsageAttribute |
|
|
|
dotnet_diagnostic.CA1018.severity = error |
|
|
|
# CA1304: Specify CultureInfo |
|
|
|
dotnet_diagnostic.CA1304.severity = warning |
|
|
|
# CA1802: Use literals where appropriate |
|
|
|
dotnet_diagnostic.CA1802.severity = warning |
|
|
|
# CA1813: Avoid unsealed attributes |
|
|
|
dotnet_diagnostic.CA1813.severity = error |
|
|
|
# CA1815: Override equals and operator equals on value types |
|
|
|
dotnet_diagnostic.CA1815.severity = warning |
|
|
|
# CA1820: Test for empty strings using string length |
|
|
|
|
|
|
|
@ -3,10 +3,10 @@ using System; |
|
|
|
namespace Avalonia.Metadata |
|
|
|
{ |
|
|
|
/// <summary>
|
|
|
|
/// Defines the ambient class/property
|
|
|
|
/// Defines the ambient class/property
|
|
|
|
/// </summary>
|
|
|
|
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property, Inherited = true)] |
|
|
|
public class AmbientAttribute : Attribute |
|
|
|
public sealed class AmbientAttribute : Attribute |
|
|
|
{ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -6,7 +6,7 @@ namespace Avalonia.Metadata |
|
|
|
/// Defines the property that contains the object's content in markup.
|
|
|
|
/// </summary>
|
|
|
|
[AttributeUsage(AttributeTargets.Property)] |
|
|
|
public class ContentAttribute : Attribute |
|
|
|
public sealed class ContentAttribute : Attribute |
|
|
|
{ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -9,7 +9,7 @@ namespace Avalonia.Metadata; |
|
|
|
/// Used on DataTemplate.DataType property so it can be inherited in compiled bindings inside of the template.
|
|
|
|
/// </remarks>
|
|
|
|
[AttributeUsage(AttributeTargets.Property)] |
|
|
|
public class DataTypeAttribute : Attribute |
|
|
|
public sealed class DataTypeAttribute : Attribute |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@ -6,7 +6,7 @@ namespace Avalonia.Metadata |
|
|
|
/// Indicates that the property depends on the value of another property in markup.
|
|
|
|
/// </summary>
|
|
|
|
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Method, Inherited = true, AllowMultiple = true)] |
|
|
|
public class DependsOnAttribute : Attribute |
|
|
|
public sealed class DependsOnAttribute : Attribute |
|
|
|
{ |
|
|
|
/// <summary>
|
|
|
|
/// Initializes a new instance of the <see cref="DependsOnAttribute"/> class.
|
|
|
|
|
|
|
|
@ -11,7 +11,7 @@ namespace Avalonia.Metadata |
|
|
|
/// may be added to its API.
|
|
|
|
/// </remarks>
|
|
|
|
[AttributeUsage(AttributeTargets.Interface)] |
|
|
|
public class NotClientImplementableAttribute : Attribute |
|
|
|
public sealed class NotClientImplementableAttribute : Attribute |
|
|
|
{ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -6,7 +6,7 @@ namespace Avalonia.Metadata |
|
|
|
/// Defines the property that contains the object's content in markup.
|
|
|
|
/// </summary>
|
|
|
|
[AttributeUsage(AttributeTargets.Property)] |
|
|
|
public class TemplateContentAttribute : Attribute |
|
|
|
public sealed class TemplateContentAttribute : Attribute |
|
|
|
{ |
|
|
|
public Type? TemplateResultType { get; set; } |
|
|
|
} |
|
|
|
|
|
|
|
@ -3,7 +3,7 @@ |
|
|
|
namespace Avalonia.Metadata |
|
|
|
{ |
|
|
|
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)] |
|
|
|
public class TrimSurroundingWhitespaceAttribute : Attribute |
|
|
|
public sealed class TrimSurroundingWhitespaceAttribute : Attribute |
|
|
|
{ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@ -6,7 +6,8 @@ namespace Avalonia.Metadata |
|
|
|
/// This API is unstable and is not covered by API compatibility guarantees between minor and
|
|
|
|
/// patch releases.
|
|
|
|
/// </summary>
|
|
|
|
public class UnstableAttribute : Attribute |
|
|
|
[AttributeUsage(AttributeTargets.All)] |
|
|
|
public sealed class UnstableAttribute : Attribute |
|
|
|
{ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -3,8 +3,8 @@ using System; |
|
|
|
namespace Avalonia.Metadata |
|
|
|
{ |
|
|
|
[AttributeUsage(AttributeTargets.Class)] |
|
|
|
public class UsableDuringInitializationAttribute : Attribute |
|
|
|
public sealed class UsableDuringInitializationAttribute : Attribute |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -6,7 +6,7 @@ namespace Avalonia.Metadata |
|
|
|
/// Indicates that a collection type should be processed as being whitespace significant by a XAML processor.
|
|
|
|
/// </summary>
|
|
|
|
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)] |
|
|
|
public class WhitespaceSignificantCollectionAttribute : Attribute |
|
|
|
public sealed class WhitespaceSignificantCollectionAttribute : Attribute |
|
|
|
{ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -6,7 +6,7 @@ namespace Avalonia.Metadata |
|
|
|
/// Maps an XML namespace to a CLR namespace for use in XAML.
|
|
|
|
/// </summary>
|
|
|
|
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] |
|
|
|
public class XmlnsDefinitionAttribute : Attribute |
|
|
|
public sealed class XmlnsDefinitionAttribute : Attribute |
|
|
|
{ |
|
|
|
/// <summary>
|
|
|
|
/// Initializes a new instance of the <see cref="XmlnsDefinitionAttribute"/> class.
|
|
|
|
|
|
|
|
@ -39,7 +39,8 @@ namespace Avalonia.Rendering.Composition.Expressions |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
internal class PrettyPrintStringAttribute : Attribute |
|
|
|
[AttributeUsage(AttributeTargets.Field)] |
|
|
|
internal sealed class PrettyPrintStringAttribute : Attribute |
|
|
|
{ |
|
|
|
public string Name { get; } |
|
|
|
|
|
|
|
|
|
|
|
@ -41,7 +41,7 @@ namespace Avalonia.Platform |
|
|
|
/// The fallback module will only be initialized if the Skia-specific module is not applicable.
|
|
|
|
/// </remarks>
|
|
|
|
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] |
|
|
|
public class ExportAvaloniaModuleAttribute : Attribute |
|
|
|
public sealed class ExportAvaloniaModuleAttribute : Attribute |
|
|
|
{ |
|
|
|
public ExportAvaloniaModuleAttribute(string name, Type moduleType) |
|
|
|
{ |
|
|
|
|
|
|
|
@ -7,7 +7,8 @@ namespace Avalonia.Controls |
|
|
|
/// When applying this to attached properties, ensure to put on both
|
|
|
|
/// the Getter and Setter methods.
|
|
|
|
/// </summary>
|
|
|
|
public class ResolveByNameAttribute : Attribute |
|
|
|
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Method)] |
|
|
|
public sealed class ResolveByNameAttribute : Attribute |
|
|
|
{ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -3,7 +3,7 @@ using System; |
|
|
|
namespace Avalonia.OpenGL |
|
|
|
{ |
|
|
|
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)] |
|
|
|
class GlMinVersionEntryPoint : Attribute |
|
|
|
sealed class GlMinVersionEntryPoint : Attribute |
|
|
|
{ |
|
|
|
public GlMinVersionEntryPoint(string entry, int minVersionMajor, int minVersionMinor) |
|
|
|
{ |
|
|
|
@ -28,7 +28,7 @@ namespace Avalonia.OpenGL |
|
|
|
} |
|
|
|
|
|
|
|
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)] |
|
|
|
class GlExtensionEntryPoint : Attribute |
|
|
|
sealed class GlExtensionEntryPoint : Attribute |
|
|
|
{ |
|
|
|
public GlExtensionEntryPoint(string entry, string extension) |
|
|
|
{ |
|
|
|
|
|
|
|
@ -3,7 +3,7 @@ |
|
|
|
namespace Avalonia.Remote.Protocol |
|
|
|
{ |
|
|
|
[AttributeUsage(AttributeTargets.Class)] |
|
|
|
public class AvaloniaRemoteMessageGuidAttribute : Attribute |
|
|
|
public sealed class AvaloniaRemoteMessageGuidAttribute : Attribute |
|
|
|
{ |
|
|
|
public Guid Guid { get; } |
|
|
|
|
|
|
|
|
|
|
|
@ -34,7 +34,8 @@ namespace Avalonia.Markup.Xaml |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public class ConstructorArgumentAttribute : Attribute |
|
|
|
[AttributeUsage(AttributeTargets.Property)] |
|
|
|
public sealed class ConstructorArgumentAttribute : Attribute |
|
|
|
{ |
|
|
|
public ConstructorArgumentAttribute(string name) |
|
|
|
{ |
|
|
|
|
|
|
|
@ -1,7 +1,8 @@ |
|
|
|
namespace System.Runtime.CompilerServices |
|
|
|
{ |
|
|
|
#if NETSTANDARD2_0
|
|
|
|
internal class ModuleInitializerAttribute : Attribute |
|
|
|
[AttributeUsage(AttributeTargets.Method)] |
|
|
|
internal sealed class ModuleInitializerAttribute : Attribute |
|
|
|
{ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@ -16,7 +16,9 @@ namespace Avalonia.SourceGenerator |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
internal class GetProcAddressAttribute : Attribute |
|
|
|
|
|
|
|
[AttributeUsage(AttributeTargets.Method)] |
|
|
|
internal sealed class GetProcAddressAttribute : Attribute |
|
|
|
{ |
|
|
|
public GetProcAddressAttribute(string proc) |
|
|
|
{ |
|
|
|
@ -39,11 +41,14 @@ namespace Avalonia.SourceGenerator |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
internal class GenerateEnumValueDictionaryAttribute : Attribute |
|
|
|
[AttributeUsage(AttributeTargets.Method)] |
|
|
|
internal sealed class GenerateEnumValueDictionaryAttribute : Attribute |
|
|
|
{ |
|
|
|
} |
|
|
|
|
|
|
|
internal class GenerateEnumValueListAttribute : Attribute |
|
|
|
|
|
|
|
[AttributeUsage(AttributeTargets.Method)] |
|
|
|
internal sealed class GenerateEnumValueListAttribute : Attribute |
|
|
|
{ |
|
|
|
} |
|
|
|
} |
|
|
|
|