78 lines
2.5 KiB
C#
78 lines
2.5 KiB
C#
internal enum RoutedEventStrategy
|
|
{
|
|
Tunnel,
|
|
Bubble,
|
|
Direct,
|
|
}
|
|
|
|
// internal sealed class RoutedEventAttribute : global::System.Attribute
|
|
// ... 省略
|
|
|
|
[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = true)]
|
|
[global::System.Diagnostics.Conditional("DEPENDENCY_PROPERTY_GENERATOR_ATTRIBUTES")]
|
|
internal sealed class RoutedEventAttribute<T> : global::System.Attribute
|
|
{
|
|
/// <summary>
|
|
/// Name of this routed event.
|
|
/// </summary>
|
|
public string Name { get; }
|
|
|
|
/// <summary>
|
|
/// Strategy of this routed event.
|
|
/// </summary>
|
|
public RoutedEventStrategy Strategy { get; }
|
|
|
|
/// <summary>
|
|
/// Type of this routed event. <br/>
|
|
/// Default - typeof(RoutedEventHandler).
|
|
/// </summary>
|
|
public global::System.Type? Type { get; set; }
|
|
|
|
/// <summary>
|
|
/// Will generates attached routed event. <br/>
|
|
/// Default - <see langword="false"/>.
|
|
/// </summary>
|
|
public bool IsAttached { get; set; }
|
|
|
|
/// <summary>
|
|
/// Description of this routed event. <br/>
|
|
/// The event will contain a <see cref="global::System.ComponentModel.DescriptionAttribute"/> with this value. <br/>
|
|
/// This will also be used in the xml documentation if not explicitly specified. <br/>
|
|
/// Default - <see langword="null"/>.
|
|
/// </summary>
|
|
public string? Description { get; set; }
|
|
|
|
/// <summary>
|
|
/// Category of this routed event. <br/>
|
|
/// The event will contain a <see cref="global::System.ComponentModel.CategoryAttribute"/> with this value. <br/>
|
|
/// Default - <see langword="null"/>.
|
|
/// </summary>
|
|
public string? Category { get; set; }
|
|
|
|
/// <summary>
|
|
/// The routed event xml documentation. <br/>
|
|
/// Default - "<summary></summary>".
|
|
/// </summary>
|
|
public string XmlDocumentation { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// The event add/remove xml documentation. <br/>
|
|
/// Default - "<summary></summary>".
|
|
/// </summary>
|
|
public string EventXmlDocumentation { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="name"></param>
|
|
/// <param name="strategy"></param>
|
|
/// <exception cref="global::System.ArgumentNullException"></exception>
|
|
public RoutedEventAttribute(
|
|
string name,
|
|
RoutedEventStrategy strategy)
|
|
{
|
|
Name = name ?? throw new global::System.ArgumentNullException(nameof(name));
|
|
Strategy = strategy;
|
|
Type = typeof(T);
|
|
}
|
|
} |