Exemplo n.º 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);
        }
        public static DeviceConnectedStatus Deserialise(Stream stream)
        {
            DeviceConnectedStatus result = new DeviceConnectedStatus();

            result.Online           = IPCHelper.ReadBoolean(stream);
            result.LastActivityTime = IPCHelper.ReadDateTime(stream);
            return(result);
        }