예제 #1
0
        /// <summary>
        /// Deserializa os dados.
        /// </summary>
        /// <param name="reader"></param>
        void Serialization.ICompactSerializable.Deserialize(Serialization.IO.CompactReader reader)
        {
            if (reader.ReadBoolean())
            {
                this.Type = new TypeName();
                this.Type.Deserialize(reader);
            }
            ContractName = reader.ReadString();
            if (reader.ReadBoolean())
            {
                ContractType = new TypeName();
                ContractType.Deserialize(reader);
            }
            ImportingConstructor = reader.ReadBoolean();
            this.CreationPolicy  = (CreationPolicy)reader.ReadInt32();
            UseDispatcher        = reader.ReadBoolean();
            UIContext            = reader.ReadString();
            var count = reader.ReadInt32();

            Metadata = new Dictionary <string, object>(count);
            for (var i = 0; i < count; i++)
            {
                var key   = reader.ReadString();
                var value = reader.ReadObject();
                Metadata.Add(key, value);
            }
        }
예제 #2
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();
 }
예제 #3
0
 /// <summary>
 /// Desserializa o parametro.
 /// </summary>
 /// <param name="reader"></param>
 public void Deserialize(Serialization.IO.CompactReader reader)
 {
     Name        = reader.ReadString();
     Direction   = (Colosoft.Query.ParameterDirection)reader.ReadInt32();
     Size        = reader.ReadInt32();
     this.DbType = (System.Data.DbType)reader.ReadInt32();
     if (reader.ReadBoolean())
     {
         Value = reader.ReadObject();
     }
 }
예제 #4
0
 public void Deserialize(Serialization.IO.CompactReader reader)
 {
     _jobType             = (RecoveryJobType)reader.ReadInt32();
     _operation           = (RecoveryOpCodes)reader.ReadInt32();
     _identifier          = reader.ReadString();
     _cluster             = reader.ReadString();
     _executionPreference = (ExecutionPreference)reader.ReadInt32();
     _configCluster       = reader.ReadString();
     _recoveryPath        = reader.ReadString();
     _renameMapping       = Util.SerializationUtility.DeserializeDictionary <string, string>(reader);
     _creationTime        = reader.ReadDateTime();
     _username            = reader.ReadString();
     _password            = reader.ReadString();
 }
예제 #5
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");
        }
예제 #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();
        }
예제 #7
0
 public void Deserialize(Serialization.IO.CompactReader reader)
 {
     Shards            = SerializationUtility.DeserializeDictionary <string, ShardConfiguration>(reader);
     DeploymentName    = SerializationUtility.DeserializeDictionary <string, string>(reader);
     DeploymentList    = SerializationUtility.DeserializeList <string>(reader);
     HeartbeatInterval = reader.ReadInt32();
 }
예제 #8
0
        public static Dictionary <T, Dictionary <V, List <K> > > DeserializeDDList <T, V, K>(Serialization.IO.CompactReader reader)
        {
            bool flag = reader.ReadBoolean();

            if (flag)
            {
                T key;

                int dictionarylength = reader.ReadInt32();
                Dictionary <T, Dictionary <V, List <K> > > dList = new Dictionary <T, Dictionary <V, List <K> > >();
                for (int i = 0; i < dictionarylength; i++)
                {
                    Dictionary <V, List <K> > valueList;
                    key       = (T)reader.ReadObject();
                    valueList = DeserializeDictionaryList <V, K>(reader);
                    dList.Add(key, valueList);
                }


                return(dList);
            }
            else
            {
                return(null);
            }
        }
예제 #9
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="reader"></param>
        /// <returns></returns>
        public static Dictionary <T, V> DeserializeDictionary <T, V>(Serialization.IO.CompactReader reader)
        {
            T    key;
            V    val;
            bool flag = reader.ReadBoolean();

            if (flag)
            {
                Dictionary <T, V> dictionary = null;
                if (typeof(string).Equals(typeof(T)))
                {
                    dictionary = new Dictionary <T, V>((IEqualityComparer <T>)StringComparer.InvariantCultureIgnoreCase);
                }
                else
                {
                    dictionary = new Dictionary <T, V>();
                }

                int Length = reader.ReadInt32();
                for (int i = 0; i < Length; i++)
                {
                    key = (T)reader.ReadObject();
                    val = (V)reader.ReadObject();

                    dictionary.Add(key, val);
                }
                return(dictionary);
            }
            else
            {
                return(null);
            }
        }
예제 #10
0
 public override void Deserialize(Serialization.IO.CompactReader reader)
 {
     Identifier          = reader.ReadString();
     Message             = reader.ReadString();
     Status              = (RecoveryStatus)reader.ReadInt32();
     PercentageExecution = reader.ReadSingle();
     MessageTime         = reader.ReadDateTime();
     StopTime            = reader.ReadDateTime();
     _cluster            = reader.ReadString();
     _shard              = reader.ReadString();
     _node               = reader.ReadString();
     _jobType            = (RecoveryJobType)reader.ReadInt32();
     Detail              = Common.Util.SerializationUtility.DeserializeList <RecoveryJobStateBase>(reader);
     _lastOperationID    = (OperationId)reader.ReadObject();
     _lastFullBackupDate = reader.ReadDateTime();
 }
예제 #11
0
 public void Deserialize(Serialization.IO.CompactReader reader)
 {
     _isLastChunk = reader.ReadBoolean();
     _readerUID   = reader.ReadString();
     _documents   = (List <IJSONDocument>)reader.ReadObject();
     _chunkId     = reader.ReadInt32();
     _queryString = reader.ReadString();
     _doCaching   = reader.ReadBoolean();
 }
예제 #12
0
 public override void Deserialize(Serialization.IO.CompactReader reader)
 {
     Identifier          = reader.ReadString();
     Message             = reader.ReadString();
     Status              = (RecoveryStatus)reader.ReadInt32();
     PercentageExecution = reader.ReadSingle();
     MessageTime         = reader.ReadDateTime();
     StopTime            = reader.ReadDateTime();
     Details             = Common.Util.SerializationUtility.DeserializeList <ShardRecoveryJobState>(reader);
 }
예제 #13
0
        void Serialization.ICompactSerializable.Deserialize(Serialization.IO.CompactReader reader)
        {
            var count = reader.ReadInt32();

            _innerList = new List <AssemblyPackage>(count);
            while (count-- > 0)
            {
                var package = new AssemblyPackage();
                package.Deserialize(reader);
                _innerList.Add(package);
            }
        }
예제 #14
0
        /// <summary>
        /// Deserializa os dados.
        /// </summary>
        /// <param name="reader"></param>
        void Serialization.ICompactSerializable.Deserialize(Serialization.IO.CompactReader reader)
        {
            _exports.Clear();
            var count = reader.ReadInt32();

            for (var i = 0; i < count; i++)
            {
                var export = new Export();
                ((Serialization.ICompactSerializable)export).Deserialize(reader);
                _exports.Add(export);
            }
        }
예제 #15
0
        public static ClusteredArray <T> DeserializeClusteredArray <T>(Serialization.IO.CompactReader reader)
        {
            bool flag = reader.ReadBoolean();

            if (flag)
            {
                int length               = reader.ReadInt32();
                int threshold            = reader.ReadInt32();
                ClusteredArray <T> array = new ClusteredArray <T>(threshold, length);

                for (int i = 0; i < length; i++)
                {
                    array[i] = (T)reader.ReadObject();
                }

                return(array);
            }
            else
            {
                return(null);
            }
        }
예제 #16
0
        /// <summary>
        /// Deserializa os dados da instancia.
        /// </summary>
        /// <param name="reader"></param>
        public void Deserialize(Serialization.IO.CompactReader reader)
        {
            _uid        = reader.ReadGuid();
            _createTime = reader.ReadDateTime();
            var count = reader.ReadInt32();

            while (count-- > 0)
            {
                var part = new AssemblyPart();
                part.Deserialize(reader);
                _items.Add(part);
            }
        }
예제 #17
0
        /// <summary>
        /// Desserializa o objeto.
        /// </summary>
        /// <param name="reader"></param>
        public void Deserialize(Serialization.IO.CompactReader reader)
        {
            _expression = reader.ReadString();
            var parameters = new List <PersistenceParameter>();
            var count      = reader.ReadInt32();

            for (var i = 0; i < count; i++)
            {
                var parameter = new PersistenceParameter();
                ((ICompactSerializable)parameter).Deserialize(reader);
                parameters.Add(parameter);
            }
            _parameters = new PersistenceParameterCollection(parameters);
        }
예제 #18
0
        public static List <T> DeserializeList <T>(Serialization.IO.CompactReader reader)
        {
            bool flag = reader.ReadBoolean();

            if (flag)
            {
                int      length = reader.ReadInt32();
                List <T> list   = new List <T>();

                for (int i = 0; i < length; i++)
                {
                    list.Add((T)reader.ReadObject());
                }

                return(list);
            }
            else
            {
                return(null);
            }
        }
예제 #19
0
        public static ArrayList DeserializeArrayList(Serialization.IO.CompactReader reader)
        {
            bool flag = reader.ReadBoolean();

            if (flag)
            {
                int       length = reader.ReadInt32();
                ArrayList list   = new ArrayList();

                for (int i = 0; i < length; i++)
                {
                    list.Add(reader.ReadObject());
                }

                return(list);
            }
            else
            {
                return(null);
            }
        }
예제 #20
0
 /// <summary>
 /// Desserializa o parametro.
 /// </summary>
 /// <param name="reader"></param>
 public void Deserialize(Serialization.IO.CompactReader reader)
 {
     Uid = reader.ReadInt32();
 }
예제 #21
0
 public void Deserialize(Serialization.IO.CompactReader reader)
 {
     this.EnvironmentOpenFlags = (LMDBEnvOpenFlags)reader.ReadInt32();
     MaxCollections            = reader.ReadInt32();
     MaxReaders = reader.ReadInt32();
 }
예제 #22
0
        /// <summary>
        /// Desserializa o objeto.
        /// </summary>
        /// <param name="reader"></param>
        public void Deserialize(Serialization.IO.CompactReader reader)
        {
            ActionId       = reader.ReadInt32();
            Type           = (PersistenceActionType)reader.ReadInt32();
            EntityFullName = reader.ReadString();
            ProviderName   = reader.ReadString();
            var RowVersionString = reader.ReadString();

            if (!string.IsNullOrEmpty(RowVersionString))
            {
                RowVersion = long.Parse(RowVersionString);
            }
            else
            {
                RowVersion = null;
            }
            var parameters = new List <PersistenceParameter>();
            var count      = reader.ReadInt32();

            for (var i = 0; i < count; i++)
            {
                var parameter = new PersistenceParameter();
                ((ICompactSerializable)parameter).Deserialize(reader);
                parameters.Add(parameter);
            }
            Parameters = new PersistenceParameterCollection(parameters);
            if (reader.ReadBoolean())
            {
                var conditional = new Colosoft.Query.ConditionalContainer();
                ((ICompactSerializable)conditional).Deserialize(reader);
                this.Conditional = conditional;
            }
            var actions = new List <PersistenceAction>();

            count = reader.ReadInt32();
            for (var i = 0; i < count; i++)
            {
                var persistenceAction = new PersistenceAction();
                ((ICompactSerializable)persistenceAction).Deserialize(reader);
                actions.Add(persistenceAction);
            }
            AlternativeActions.AddRange(actions);
            var beforeActions = new List <PersistenceAction>();

            count = reader.ReadInt32();
            for (var i = 0; i < count; i++)
            {
                var persistenceAction = new PersistenceAction();
                ((ICompactSerializable)persistenceAction).Deserialize(reader);
                beforeActions.Add(persistenceAction);
            }
            BeforeActions.AddRange(beforeActions);
            var afterActions = new List <PersistenceAction>();

            count = reader.ReadInt32();
            for (var i = 0; i < count; i++)
            {
                var persistenceAction = new PersistenceAction();
                ((ICompactSerializable)persistenceAction).Deserialize(reader);
                afterActions.Add(persistenceAction);
            }
            AfterActions.AddRange(afterActions);
            if (reader.ReadBoolean())
            {
                _storedProcedureName = new Colosoft.Query.StoredProcedureName();
                ((ICompactSerializable)_storedProcedureName).Deserialize(reader);
            }
            if (reader.ReadBoolean())
            {
                var query = new Colosoft.Query.QueryInfo();
                ((ICompactSerializable)query).Deserialize(reader);
                this.Query = query;
            }
        }
예제 #23
0
 public void Deserialize(Serialization.IO.CompactReader reader)
 {
     _element = reader.ReadObject() as IComparable;
     _index   = reader.ReadInt32();
 }
예제 #24
0
 public void Deserialize(Serialization.IO.CompactReader reader)
 {
     _count = reader.ReadInt32();
     _pairs = reader.ReadObject() as KeyValuePair[];
 }