-
Notifications
You must be signed in to change notification settings - Fork 756
Domain reload test cases fixes #1287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
fc7da1d
72fafdd
20861b2
2253ef3
635edac
0ee931e
3dad96e
90a81f3
10276f1
4d0e2ce
02fa245
91c881c
284e8e1
fe96781
6ff9e0b
4d2d05b
5f061bc
3adc559
e8543cf
61b0d8c
c8bacf3
cde5c23
a956773
ee3b391
9b4d5f9
a2f3294
46dcb9d
10116bb
102054e
329de5d
f97262b
ceb3fab
2d6ae4c
16a39a6
ace340d
78a8088
3232f79
87287a5
44b4800
79516f1
421f665
5e4c976
9d1991a
bcf0cd6
73e5a6b
510a7ae
21eb14c
59e81e2
1383b5a
fbc06ef
b3e86da
0b027c6
b4533c4
0a3f044
639236a
3069285
5c14aad
00c19d5
833e836
62ae107
eedbae5
73f39bc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
So that we can use that same logic when deserializing Maybe* types
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,11 +13,6 @@ internal struct MaybeMemberInfo<T> : ISerializable where T: MemberInfo | |
|
||
string name; | ||
MemberInfo info; | ||
|
||
// As seen in ClassManager.GetClassInfo | ||
const BindingFlags k_flags = BindingFlags.Static | | ||
BindingFlags.Instance | | ||
BindingFlags.Public ; | ||
|
||
public string DeletedMessage | ||
{ | ||
|
@@ -64,14 +59,41 @@ internal MaybeMemberInfo(SerializationInfo serializationInfo, StreamingContext c | |
if (tp != null) | ||
{ | ||
var field_name = serializationInfo.GetString("f"); | ||
info = tp.GetField(field_name, k_flags); | ||
MemberInfo mi = tp.GetField(field_name, ClassManager.BindingFlags); | ||
if (mi != null && ShouldBindMember(mi)) | ||
{ | ||
info = mi; | ||
} | ||
} | ||
} | ||
catch | ||
{ | ||
} | ||
} | ||
|
||
// This is complicated because we bind fields | ||
// based on the visibility of the field, properties | ||
// based on it's setter/getter (which is a method | ||
// info) visibility and events based on their | ||
// AddMethod visibility. | ||
static bool ShouldBindMember(MemberInfo mi) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not totally satisfied with this solution, but it's the best I could find. If anyone has a better idea.. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could also leave this abstract and have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But maybe that's not critical. |
||
{ | ||
if (mi is PropertyInfo pi) | ||
{ | ||
return ClassManager.ShouldBindProperty(pi); | ||
} | ||
else if (mi is FieldInfo fi) | ||
{ | ||
return ClassManager.ShouldBindField(fi); | ||
} | ||
else if (mi is EventInfo ei) | ||
{ | ||
return ClassManager.ShouldBindEvent(ei); | ||
} | ||
|
||
return false; | ||
} | ||
|
||
public void GetObjectData(SerializationInfo serializationInfo, StreamingContext context) | ||
{ | ||
serializationInfo.AddValue("s", name); | ||
|
Uh oh!
There was an error while loading. Please reload this page.