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