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
PersonID : 2, ActionType :True, ExistInContactManager :True
PersonID : 3, ActionType :False, ExistInContactManager :False
PersonID : 4, ActionType :False, ExistInContactManager :False
PersonID : 5, ActionType :False, ExistInContactManager :False
PersonID : 6, ActionType :True, ExistInContactManager :True
PersonID : 3, ActionType :False, ExistInContactManager :False
PersonID : 4, ActionType :False, ExistInContactManager :False
PersonID : 5, ActionType :False, ExistInContactManager :False
PersonID : 6, ActionType :True, ExistInContactManager :True