-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHelper.cs
More file actions
54 lines (45 loc) · 1.07 KB
/
Helper.cs
File metadata and controls
54 lines (45 loc) · 1.07 KB
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
53
54
using System;
namespace DataKeeper
{
#region enums
[Flags]
public enum TriggerType
{
Before = 1,
After = 2,
Both = Before | After
}
[Flags]
public enum BindType
{
OnUpdate = 1,
OnRemove = 2,
OnAll = OnUpdate | OnRemove
}
public enum ActivityStatus
{
Inactive,
Active
}
#endregion
internal static class Extentions
{
public static bool TriggerHasFlag(this TriggerType triggerType, TriggerType flag)
{
// Faster than native Enum.HasFlag
return (triggerType & flag) == flag;
}
public static bool BindTypeHasFlag(this BindType bindType, BindType flag)
{
return (bindType & flag) == flag;
}
internal static dynamic __Add<T>(this object left, T right)
{
return (dynamic)left + (dynamic)right;
}
internal static dynamic __Substract<T>(this object left, T right)
{
return (dynamic)left - (dynamic)right;
}
}
}