-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathExamplesAPIType.cs
38 lines (31 loc) · 1004 Bytes
/
ExamplesAPIType.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
// <copyright file="ExamplesAPIType.cs" company="DocuSign">
// Copyright (c) DocuSign. All rights reserved.
// </copyright>
using System.ComponentModel;
namespace DocuSign.CodeExamples.Common
{
public enum ExamplesAPIType
{
[Description("Reg")]
Rooms = 0,
[Description("eg")]
ESignature = 1,
[Description("ClickEg")]
Click = 2,
[Description("monitorExample")]
Monitor = 3,
[Description("Aeg")]
Admin = 4,
}
public static class ExamplesAPITypeExtensions
{
public static string ToKeywordString(this ExamplesAPIType val)
{
DescriptionAttribute[] attributes = (DescriptionAttribute[])val
.GetType()
.GetField(val.ToString())
.GetCustomAttributes(typeof(DescriptionAttribute), false);
return attributes.Length > 0 ? attributes[0].Description : string.Empty;
}
}
}