38
1
using System;
2
3
/// <summary>
4
/// 권한3 옵션
5
/// </summary>
6
[Flags]
7
public enum Auth3Type
8
{
9
None = 0
10
11
, Opt0 = 1 << 0
12
, Opt1 = 1 << 1
13
, Opt2 = 1 << 2
14
, Opt3 = 1 << 3
15
, Opt4 = 1 << 4
16
, Opt5 = 1 << 5
17
, Opt6 = 1 << 6
18
19
, OptAll = int.MaxValue
20
}
21
22
public class Program
23
{
24
public static void Main()
25
{
26
Console.WriteLine("----- Auth3Type ----");
27
Auth3Type typeAuth3 = Auth3Type.None;
28
29
typeAuth3 = Auth3Type.Opt1 | Auth3Type.Opt5;
30
//typeAuth3 = Auth3Type.OptAll;
31
32
Console.WriteLine("value : " + typeAuth3.GetHashCode());
33
Console.WriteLine("string : " + ((Auth3Type)typeAuth3).ToString());
34
Console.WriteLine("Auth3Type.Opt1 : " + typeAuth3.HasFlag(Auth3Type.Opt1));
35
Console.WriteLine("Auth3Type.Opt2 : " + typeAuth3.HasFlag(Auth3Type.Opt2));
36
Console.WriteLine(" ");
37
}
38
}
Cached Result