forked from nanoframework/nanoFramework.IoT.Device
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTelemetryAttribute.cs
52 lines (47 loc) · 1.95 KB
/
TelemetryAttribute.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
50
51
52
// 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>
/// Telemetry of the interface.
/// </summary>
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public class TelemetryAttribute : Attribute
{
/// <summary>
/// Gets name of the telemetry in the interface.
/// </summary>
public string? Name { get; }
/// <summary>
/// Gets display name of the telemetry.
/// </summary>
public string? DisplayName { get; }
/// <summary>
/// Initializes a new instance of the <see cref="TelemetryAttribute" /> class.
/// </summary>
/// <param name="name">Name of the telemetry. If not provided property name will be used.</param>
/// <param name="displayName">Optional display name of the telemetry. If not provided it may be infered from the type.</param>
/// <remarks>When put on methods name should always be provided.</remarks>
public TelemetryAttribute(string? name, string? displayName)
{
Name = name;
DisplayName = displayName;
}
/// <summary>
/// Initializes a new instance of the <see cref="TelemetryAttribute" /> class.
/// </summary>
/// <param name="name">Name of the telemetry. If not provided property name will be used.</param>
/// <remarks>When put on methods name should always be provided.</remarks>
public TelemetryAttribute(string? name)
{
Name = name;
}
/// <summary>
/// Initializes a new instance of the <see cref="TelemetryAttribute" /> class.
/// </summary>
/// <remarks>When put on methods name should always be provided.</remarks>
public TelemetryAttribute()
{
}
}
}