repo.or.cz
/
mono-project.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
[netcore] Implement/fix enum/nullable comparers.
[mono-project.git]
/
mono
/
tests
/
cattr-field.cs
blob
b1517129bbd6fb18e26e7d6648d60349b711a3f9
1
using
System
;
2
3
[
My
(
val
=
2
,
sval
=
"str"
,
bb
=
0
,
S
=
"Buh"
,
P
=
4
)]
4
class
T
{
5
static int
Main
() {
6
object
[]
a
=
Attribute
.
GetCustomAttributes
(
typeof
(
T
),
true
);
7
My attr
= (
My
)
a
[
0
];
8
if
(
attr
.
val
!=
2
)
9
return
1
;
10
if
(
attr
.
P
!=
4
)
11
return
2
;
12
if
(
attr
.
S
!=
"Buh"
)
13
return
3
;
14
return
0
;
15
}
16
}
17
18
class
My
:
Attribute
{
19
public int
val
;
20
public uint
prop
;
21
public string
s
;
22
public string
sval
;
23
public byte
bb
;
24
public uint
P
{
25
set
{prop = value;}
26
get
{return prop;}
27
}
28
public string
S
{
29
set
{s = value;}
30
get
{return s;}
31
}
32
}