2using System.Collections.Generic;
11 internal class ObjectInfo
13 private Dictionary<string, PropertyReference> sorted =
null;
14 public PropertyReference[] Properties;
22 public void Serialize(
Serializer Output,
object Object)
28 Type T = Object.GetType();
29 ObjectInfo Info =
this;
47 foreach (PropertyReference
Property in Info.Properties)
50 object Value =
Property.Info.GetValue(Object);
65 public object Deserialize(
Deserializer Input, Type ExpectedType)
72 else if (
string.IsNullOrEmpty(TypeName))
78 throw new KeyNotFoundException(
"Type name not recognized: " + TypeName);
87 if (Info.sorted is
null)
89 Dictionary<string, PropertyReference> Sorted =
new Dictionary<string, PropertyReference>();
91 foreach (PropertyReference P
in Info.Properties)
97 object Result = Activator.CreateInstance(Info.Type);
100 while (!
string.IsNullOrEmpty(PropertyName))
102 if (!Info.sorted.TryGetValue(PropertyName, out PropertyReference P))
103 throw new KeyNotFoundException(
"Property Name not found: " + Info.Type.FullName +
"." + PropertyName);
105 P.Info.SetValue(Result, P.Property.Deserialize(Input, P.Property.PropertyType));
Represents one endpoint (or participant) in the network cluster.
string ReadString()
Reads a string from the input.
Abstract base class for properties
abstract void Serialize(Serializer Output, object Value)
Serializes the property value of an object.
void WriteString(string Value)
Writes a string to the output.
void WriteByte(byte Value)
Writes a byte to the output.
Static class that dynamically manages types and interfaces available in the runtime environment.
static Type GetType(string FullName)
Gets a type, given its full name.
Abstract base class for properties
object Deserialize(Deserializer Input, Type ExpectedType)
Deserializes the property value
void Serialize(Serializer Output, object Value)
Serializes the property value of an object.