예제 #1
0
        public static Client Deserialise(Stream stream)
        {
            Client result = new Client();

            result.ClientID = IPCHelper.ReadGuid(stream);
            result.Name     = IPCHelper.ReadString(stream);
            DateTime?dateTime = IPCHelper.ReadDateTime(stream);

            if (dateTime.HasValue)
            {
                result.Lifetime = dateTime.Value;
            }
            string version = IPCHelper.ReadString(stream);

            result.Version = Version.Parse(version);
            string       bindingModeText = IPCHelper.ReadString(stream);
            TBindingMode bindingMode;

            if (Enum.TryParse <TBindingMode>(bindingModeText, true, out bindingMode))
            {
                result.BindingMode = bindingMode;
            }
            result.SMSNumber      = IPCHelper.ReadString(stream);
            result.SupportedTypes = ObjectTypes.Deserialise(stream);
            return(result);
        }
예제 #2
0
        public static Property Deserialise(System.IO.Stream stream)
        {
            Property property = new Property();

            property.PropertyDefinitionID = IPCHelper.ReadGuid(stream);
            property.PropertyID           = IPCHelper.ReadString(stream);
            byte nullItem = IPCHelper.ReadByte(stream);

            if (nullItem == 1)
            {
                property.Value = new PropertyValue()
                {
                    Value = IPCHelper.ReadString(stream)
                };
            }
            int valueCount = IPCHelper.ReadInt32(stream);

            for (int valueIndex = 0; valueIndex < valueCount; valueIndex++)
            {
                PropertyValue value = new PropertyValue();
                value.PropertyValueID = IPCHelper.ReadString(stream);
                value.Value           = IPCHelper.ReadString(stream);
                if (property.Values == null)
                {
                    property.Values = new List <PropertyValue>();
                }
                property.Values.Add(value);
            }
            return(property);
        }
예제 #3
0
        public static Object Deserialise(Stream stream)
        {
            Object result = new Object();

            result.ObjectDefinitionID = IPCHelper.ReadGuid(stream);
            result.ObjectID           = IPCHelper.ReadString(stream);
            result.InstanceID         = IPCHelper.ReadString(stream);
            int count = IPCHelper.ReadInt32(stream);

            if (count > 0)
            {
                for (int index = 0; index < count; index++)
                {
                    Property property = Property.Deserialise(stream);
                    result.Properties.Add(property);
                }
            }
            return(result);
        }
예제 #4
0
 public Guid ReadGuid()
 {
     return(IPCHelper.ReadGuid(_Payload));
 }