public static string Demarshal(Stream stream) { int size = Int32Marshaler.Demarshal(stream); byte[] data = new byte[size]; stream.Read(data, 0, data.Length); return(Encoding.Unicode.GetString(data)); }
public static byte[] Demarshal(Stream stream) { int length = Int32Marshaler.Demarshal(stream); byte[] array = new byte[length]; if (length > 0) { stream.Read(array, 0, array.Length); } return(array); }
public object DemarshalObject(Stream stream) { int count = Int32Marshaler.Demarshal(stream); IList list = (IList)Activator.CreateInstance(ManagedType); for (int i = 0; i < count; i++) { object element = _elementMarshaler.DemarshalObject(stream); list.Add(element); } return(list); }
public static StringDictionary Demarshal(Stream stream) { StringDictionary dictionary = new StringDictionary(); int count = Int32Marshaler.Demarshal(stream); for (int i = 0; i < count; i++) { string key = StringMarshaler.Demarshal(stream); string value = StringMarshaler.Demarshal(stream); dictionary.Add(key, value); } return(dictionary); }
public object DemarshalObject(Stream stream) { int count = Int32Marshaler.Demarshal(stream); Type elementType = _elementMarshaler.ManagedType; Array array = Array.CreateInstance(elementType, count); for (int i = 0; i < count; i++) { object element = _elementMarshaler.DemarshalObject(stream); array.SetValue(element, i); } return(array); }
public object DemarshalObject(Stream stream) { List <UniqueSettings> collection = new List <UniqueSettings>(); int count = Int32Marshaler.Demarshal(stream); for (int i = 0; i < count; i++) { UniqueSettings element = (UniqueSettings)_elementMarshaler.DemarshalObject(stream); collection.Add(element); } DynamicSettings settings = (DynamicSettings)Activator.CreateInstance(ManagedType, collection); return(settings); }
public object DemarshalObject(Stream stream) { Dictionary <Guid, DynamicSettingsValue> collection = new Dictionary <Guid, DynamicSettingsValue>(); int count = Int32Marshaler.Demarshal(stream); for (int i = 0; i < count; i++) { Guid key = GuidMarshaler.Demarshal(stream); byte[] data = ByteArrayMarshaler.Demarshal(stream); DynamicSettingsValue entry = new DynamicSettingsValue(); entry.Deserialize(data); collection.Add(key, entry); } DynamicSettings settings = (DynamicSettings)Activator.CreateInstance(ManagedType, collection); return(settings); }