2using System.Reflection;
11 private readonly Type nullableType;
12 private readonly Type elementType;
13 private readonly ConstructorInfo constructor;
14 private readonly PropertyInfo valueProperty;
23 this.nullableType = NullableType;
24 this.elementType = ElementType;
25 this.element = Element;
26 this.constructor =
null;
28 foreach (ConstructorInfo CI
in this.nullableType.GetTypeInfo().DeclaredConstructors)
30 ParameterInfo[] P = CI.GetParameters();
31 if (P.Length == 1 && P[0].ParameterType ==
this.elementType)
33 this.constructor = CI;
38 this.valueProperty = this.nullableType.GetRuntimeProperty(
"Value");
58 this.element.Serialize(Output, this.valueProperty.GetMethod.Invoke(Value,
null));
71 return this.element.Deserialize(Input, this.elementType);
bool ReadBoolean()
Reads a boolean value from the input.
override void Serialize(Serializer Output, object Value)
Serializes the property value of an object.
override Type PropertyType
Property Type
NullableProperty(Type NullableType, Type ElementType, IProperty Element)
Nullable property
override object Deserialize(Deserializer Input, Type ExpectedType)
Deserializes the property value
Abstract base class for properties
void WriteBoolean(bool Value)
Writes a boolean value to the output.
Abstract base class for properties