FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
SharpUtils/Reflection/CustomTypeModifier.cs at master · IS4Code/SharpUtils · GitHub
IS4Code
/
SharpUtils
Public
Notifications
You must be signed in to change notification settings
Fork
13
Star
83
Code
Issues
0
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
SharpUtils
/
Reflection
/
CustomTypeModifier.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
100 lines (85 loc) · 3.2 KB
Breadcrumbs
SharpUtils
/
Reflection
/
CustomTypeModifier.cs
Copy path
File metadata and controls
100 lines (85 loc) · 3.2 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
using
System
;
using
System
.
Reflection
.
Emit
;
using
System
.
Runtime
.
CompilerServices
;
using
IllidanS4
.
SharpUtils
.
Reflection
.
Emit
;
namespace
IllidanS4
.
SharpUtils
.
Reflection
{
public
sealed
class
CustomTypeModifier
:
TypeModifier
,
IEquatable
<
CustomTypeModifier
>
{
public
static
readonly
Type
IsBoxed
=
typeof
(
IsBoxed
)
;
public
static
readonly
Type
IsByValue
=
typeof
(
IsByValue
)
;
public
static
readonly
Type
IsConst
=
typeof
(
IsConst
)
;
public
static
readonly
Type
IsCopyConstructed
=
typeof
(
IsCopyConstructed
)
;
public
static
readonly
Type
IsExplicitlyDereferenced
=
typeof
(
IsExplicitlyDereferenced
)
;
public
static
readonly
Type
IsImplicitlyDereferenced
=
typeof
(
IsImplicitlyDereferenced
)
;
public
static
readonly
Type
IsJitIntrinsic
=
typeof
(
IsJitIntrinsic
)
;
public
static
readonly
Type
IsLong
=
typeof
(
IsLong
)
;
public
static
readonly
Type
IsPinned
=
typeof
(
IsPinned
)
;
public
static
readonly
Type
IsSignUnspecifiedByte
=
typeof
(
IsSignUnspecifiedByte
)
;
public
static
readonly
Type
IsUdtReturn
=
typeof
(
IsUdtReturn
)
;
public
static
readonly
Type
IsVolatile
=
typeof
(
IsVolatile
)
;
public
static
readonly
Type
CompilerMarshalOverride
=
typeof
(
CompilerMarshalOverride
)
;
public
static
readonly
Type
CallConvCdecl
=
typeof
(
CallConvCdecl
)
;
public
static
readonly
Type
CallConvFastcall
=
typeof
(
CallConvFastcall
)
;
public
static
readonly
Type
CallConvStdcall
=
typeof
(
CallConvStdcall
)
;
public
static
readonly
Type
CallConvThiscall
=
typeof
(
CallConvThiscall
)
;
public
Type
ModifierType
{
get
;
private
set
;
}
public
bool
IsRequired
{
get
;
private
set
;
}
public
bool
IsOptional
{
get
{
return
!
IsRequired
;
}
}
public
CustomTypeModifier
(
Type
classRef
)
:
this
(
classRef
,
false
)
{
}
public
CustomTypeModifier
(
Type
classRef
,
bool
required
)
:
base
(
required
?
CorElementType
.
CModReqd
:
CorElementType
.
CModOpt
)
{
if
(
classRef
==
null
)
throw
new
ArgumentNullException
(
"classRef"
)
;
ModifierType
=
classRef
;
IsRequired
=
required
;
}
public
override
bool
Equals
(
object
obj
)
{
CustomTypeModifier
other
=
obj
as
CustomTypeModifier
;
if
(
other
==
null
)
return
false
;
return
Equals
(
other
)
;
}
public
override
bool
Equals
(
TypeModifier
other
)
{
return
Equals
(
(
object
)
other
)
;
}
public
bool
Equals
(
CustomTypeModifier
other
)
{
return
this
.
ModifierType
==
other
.
ModifierType
&&
this
.
IsRequired
==
other
.
IsRequired
;
}
public
override
int
GetHashCode
(
)
{
int
hashCode
=
0
;
unchecked
{
if
(
ModifierType
!=
null
)
hashCode
+=
1000000007
*
ModifierType
.
GetHashCode
(
)
;
hashCode
+=
1000000009
*
IsRequired
.
GetHashCode
(
)
;
}
return
hashCode
;
}
public
static
bool
operator
==
(
CustomTypeModifier
lhs
,
CustomTypeModifier
rhs
)
{
if
(
ReferenceEquals
(
lhs
,
rhs
)
)
return
true
;
if
(
ReferenceEquals
(
lhs
,
null
)
||
ReferenceEquals
(
rhs
,
null
)
)
return
false
;
return
lhs
.
Equals
(
rhs
)
;
}
public
static
bool
operator
!=
(
CustomTypeModifier
lhs
,
CustomTypeModifier
rhs
)
{
return
!
(
lhs
==
rhs
)
;
}
public
override
string
ToString
(
)
{
return
(
IsRequired
?
"modreq"
:
"modopt"
)
+
"("
+
ModifierType
+
")"
;
}
protected
override
void
AddSignature
(
SignatureHelper
signature
)
{
signature
.
AddElementType
(
ElementType
)
;
signature
.
AddTypeToken
(
ModifierType
)
;
}
}
}
Back
|
FazBrowse Home
|
New Git URL