Exemplo n.º 1
0
 public void Deserialize(Serialization.IO.CompactReader reader)
 {
     ElectionId = reader.ReadInt64();
     Id         = reader.ReadInt64();
     ElectionBasedSequenceId = reader.ReadInt64();
     TimeStamp = new DateTime(reader.ReadInt64());
 }
Exemplo n.º 2
0
        /// <summary>
        /// Deserializa o valor.
        /// </summary>
        /// <param name="reader"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        private object Deserialize(Serialization.IO.CompactReader reader, PrimitiveTypes type)
        {
            switch (type)
            {
            case PrimitiveTypes.Null:
                return(null);

            case PrimitiveTypes.Boolean:
                return(reader.ReadBoolean());

            case PrimitiveTypes.Byte:
                return(reader.ReadByte());

            case PrimitiveTypes.Bytes:
                var length = reader.ReadInt32();
                return(reader.ReadBytes(length));

            case PrimitiveTypes.Char:
                return(reader.ReadChar());

            case PrimitiveTypes.DateTime:
                return(reader.ReadDateTime());

            case PrimitiveTypes.DateTimeOffset:
                return(new DateTimeOffset(reader.ReadInt64(), new TimeSpan(reader.ReadInt64())));

            case PrimitiveTypes.Decimal:
                return(reader.ReadDecimal());

            case PrimitiveTypes.Double:
                return(reader.ReadDouble());

            case PrimitiveTypes.Int16:
                return(reader.ReadInt16());

            case PrimitiveTypes.Int32:
                return(reader.ReadInt32());

            case PrimitiveTypes.Int64:
                return(reader.ReadInt64());

            case PrimitiveTypes.Single:
                return(reader.ReadSingle());

            case PrimitiveTypes.String:
                return(reader.ReadString());
            }
            throw new InvalidOperationException("Invalid PrimitiveType");
        }
Exemplo n.º 3
0
 public void Deserialize(Serialization.IO.CompactReader reader)
 {
     this.RequestId       = reader.ReadInt64();
     this.Source          = (Alachisoft.NosDB.Common.Net.Address)reader.ReadObject();
     this.ResponseMessage = reader.ReadObject();
     this.Error           = reader.ReadObject() as Exception;
 }
Exemplo n.º 4
0
 public void Deserialize(Serialization.IO.CompactReader reader)
 {
     RequestId       = reader.ReadInt64();
     ResponseMessage = reader.ReadObject();
     Source          = reader.ReadObject() as Net.Address;
     Exception       = reader.ReadObject() as System.Exception;
     ReturnVal       = reader.ReadObject() as byte[];
 }
Exemplo n.º 5
0
 public void Deserialize(Serialization.IO.CompactReader reader)
 {
     RequestId      = reader.ReadInt64();
     Message        = reader.ReadObject();
     NoResponse     = reader.ReadBoolean();
     MethodName     = reader.ReadObject() as string;
     Parameters     = reader.ReadObject() as TargetMethodParameter;
     Overload       = reader.ReadInt32();
     CommandVersion = reader.ReadInt32();
 }
Exemplo n.º 6
0
        /// <summary>
        /// Desserializa o objeto.
        /// </summary>
        /// <param name="reader"></param>
        public void Deserialize(Serialization.IO.CompactReader reader)
        {
            ActionId       = reader.ReadInt32();
            Success        = reader.ReadBoolean();
            AffectedRows   = reader.ReadInt32();
            RowVersion     = reader.ReadInt64();
            FailureMessage = reader.ReadString();
            if (reader.ReadBoolean())
            {
                Result = reader.ReadObject();
            }
            var parameters = new List <PersistenceParameter>();

            while (reader.ReadBoolean())
            {
                PersistenceParameter parameter = new PersistenceParameter();
                ((ICompactSerializable)parameter).Deserialize(reader);
                parameters.Add(parameter);
            }
            Parameters = parameters.ToArray();
            var actions = new List <PersistenceActionResult>();

            while (reader.ReadBoolean())
            {
                PersistenceActionResult action = new PersistenceActionResult();
                ((ICompactSerializable)action).Deserialize(reader);
                actions.Add(action);
            }
            AlternativeActions = actions.ToArray();
            var beforeActions = new List <PersistenceActionResult>();

            while (reader.ReadBoolean())
            {
                PersistenceActionResult action = new PersistenceActionResult();
                ((ICompactSerializable)action).Deserialize(reader);
                beforeActions.Add(action);
            }
            BeforeActions = beforeActions.ToArray();
            var afterActions = new List <PersistenceActionResult>();

            while (reader.ReadBoolean())
            {
                PersistenceActionResult action = new PersistenceActionResult();
                ((ICompactSerializable)action).Deserialize(reader);
                afterActions.Add(action);
            }
            AfterActions = afterActions.ToArray();
        }
Exemplo n.º 7
0
 public void Deserialize(Serialization.IO.CompactReader reader)
 {
     _lastStart = reader.ReadInt64();
     _lastStop  = reader.ReadInt64();
 }
Exemplo n.º 8
0
 public void Deserialize(Serialization.IO.CompactReader reader)
 {
     CacheSpace  = reader.ReadInt64();
     CachePolicy = reader.ReadObject() as string;
 }