forked from nanoframework/nanoFramework.IoT.Device
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCommandAttribute.cs
49 lines (44 loc) · 1.66 KB
/
CommandAttribute.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace System.Device.Model
{
/// <summary>
/// Command of the interface.
/// </summary>
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public class CommandAttribute : Attribute
{
/// <summary>
/// Gets name of the command in the interface.
/// </summary>
public string? Name { get; }
/// <summary>
/// Gets display name of the command.
/// </summary>
public string? DisplayName { get; }
/// <summary>
/// Initializes a new instance of the <see cref="CommandAttribute" /> class.
/// </summary>
/// <param name="name">Optional name of the command in the interface. If not provided method name will be used.</param>
/// <param name="displayName">Optional name of the command in the interface.</param>
public CommandAttribute(string? name, string? displayName)
{
Name = name;
DisplayName = displayName;
}
/// <summary>
/// Initializes a new instance of the <see cref="CommandAttribute" /> class.
/// </summary>
/// <param name="name">Optional name of the command in the interface. If not provided method name will be used.</param>
public CommandAttribute(string? name)
{
Name = name;
}
/// <summary>
/// Initializes a new instance of the <see cref="CommandAttribute" /> class.
/// </summary>
public CommandAttribute()
{
}
}
}