Esempio n. 1
0
            public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
            {
#if FAST_SERIALIZATION
                using (SerializationWriter writer = new SerializationWriter())
                {
                    if (!_Parent.Parent.ColumnsSortedByUniqueId.ContainsKey(Column.UniqueId))
                    {
                        if (_Parent.Parent.ColumnsSortedByName.ContainsKey(Column.Name))
                        {
                            Column.UniqueId = _Parent.Parent.ColumnsSortedByName[Column.Name].UniqueId;
                        }
                    }
                    writer.Write(_alias);
                    writer.WriteObject(Column.UniqueId);
                    writer.Write(_compareOperator);
                    writer.Write(_logicalOperator);
                    info.AddValue("d", writer.ToArray());
                }
#else
                info.AddValue("Alias", _alias);
                info.AddValue("Column", _column);
                info.AddValue("CompareOperator", _compareOperator);
                info.AddValue("LogicalOperator", _logicalOperator);
#endif
            }
Esempio n. 2
0
        public override void GetObjectData(SerializationInfo info, StreamingContext context)
        {
#if FAST_SERIALIZATION
            using (SerializationWriter writer = new SerializationWriter())
            {
                writer.Write(UniqueId);
                writer.Write(_alias);
                //writer.Write(_columns);
                writer.Write(ScriptBase.GetUniqueIds(Columns));
                writer.Write(_enabled);
                //writer.WriteObject(_exposedUserOptions);
                writer.Write(_isUserDefined);
                writer.Write(_name);
                //writer.WriteObject(_parent);
                writer.Write(_type);
                writer.WriteObject(_userOptions);
                info.AddValue("d", writer.ToArray());
            }
#else
            info.AddValue("SerializationVersion", SerializationVersion);
            info.AddValue("Alias", _alias);
            info.AddValue("Columns", _columns);
            info.AddValue("Enabled", _enabled);
            //info.AddValue("ExposedUserOptions", this._exposedUserOptions);
            info.AddValue("IsUserDefined", _isUserDefined);
            info.AddValue("Name", _name);
            info.AddValue("Parent", _parent);
            info.AddValue("Type", _type);
            info.AddValue("UserOptions", _userOptions);
            info.AddValue("Description", _description);
#endif
        }
Esempio n. 3
0
            public byte[] Serialize()
            {
                var _SerializationWriter = new SerializationWriter();
                _SerializationWriter.WriteString(Message);

                return _SerializationWriter.ToArray();
            }
Esempio n. 4
0
        public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
        {
#if FAST_SERIALIZATION
            using (SerializationWriter writer = new SerializationWriter())
            {
                writer.Write(this.UniqueId);

                foreach (ScriptObject so in _PrimaryObject.Database.AllScriptObjects)
                {
                    if (so.Name == _AssociatedObject.Name && so.UniqueId != _AssociatedObject.UniqueId)
                    {
                        _AssociatedObject.UniqueId = so.UniqueId;
                    }
                }
                writer.Write(_AssociatedObject.UniqueId);
                writer.Write(_AssociationKind);
                writer.WriteObject(_Mappings);
                writer.Write(_Name);
                writer.Write(_Enabled);
                info.AddValue("d", writer.ToArray());
            }
#else
            info.AddValue("SerializationVersion", ScriptBase.SerializationVersion);
            info.AddValue("AssociatedObject", _AssociatedObject);
            info.AddValue("PrimaryObject", _PrimaryObject);
            info.AddValue("AssociationKind", _AssociationKind);
            info.AddValue("Mappings", _Mappings);
            info.AddValue("Name", _Name);
            info.AddValue("Enabled", _Enabled);
#endif
        }
Esempio n. 5
0
            public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
            {
#if FAST_SERIALIZATION
                using (SerializationWriter writer = new SerializationWriter())
                {
                    writer.Write(PrimaryColumn.UniqueId);

                    if (AssociatedColumn == null)
                    {
                        writer.Write(string.Empty);
                    }
                    else
                    {
                        writer.Write(AssociatedColumn.UniqueId);
                    }
                    if (AssociatedParameter == null)
                    {
                        writer.Write(string.Empty);
                    }
                    else
                    {
                        writer.Write(AssociatedParameter.UniqueId);
                    }
                    info.AddValue("d", writer.ToArray());
                }
#else
                info.AddValue("SerializationVersion", ScriptBase.SerializationVersion);
                info.AddValue("PrimaryColumn", _PrimaryColumn);
                info.AddValue("AssociatedColumn", _AssociatedColumn);
                info.AddValue("AssociatedParameter", _AssociatedParameter);
#endif
            }
            public byte[] Serialize()
            {
                var _SerializationWriter = new SerializationWriter();
                _SerializationWriter.WriteString(ThrowedException);

                return _SerializationWriter.ToArray();
            }
Esempio n. 7
0
        public byte[] Serialize()
        {
            SerializationWriter writer = new SerializationWriter();

            writer.WriteObject(ServerName);
            writer.WriteObject(Name);
            if (Type == ObjectTypes.Actor)
            {
                writer.WriteObject((byte)0);
            }
            else
            if (Type == ObjectTypes.Sensor)
            {
                writer.WriteObject((byte)1);
            }
            else
            if (Type == ObjectTypes.Unknown)
            {
                writer.WriteObject((byte)2);
            }

            writer.WriteObject(TypeName);
            writer.WriteObject(Timecode.Ticks);
            writer.WriteObject(XS1ObjectID);
            writer.WriteObject(Value);

            return(writer.ToArray());
        }
Esempio n. 8
0
        /// <summary>
        /// Implementing the ISerializable to provide a faster, more optimized
        /// serialization for the class.
        /// </summary>
        /// <param name="info"></param>
        /// <param name="context"></param>
        public void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            SerializationWriter writer = new SerializationWriter();

            writer.Write(Id);
            writer.Write((int)State);
            writer.Write(RequestResponse);
            writer.Write(Parameters);

            // It is possible to not be able to construct method info here;
            // in this case we shall only contain the name, since we may
            // need it later on.
            if (MethodInfoLocal != null)
            {
                writer.Write(SerializationHelper.SerializeMethodBaseToString(MethodInfoLocal, true));
            }
            else if (string.IsNullOrEmpty(_methodInfoName) == false)
            {
                writer.Write(_methodInfoName);
            }
            else
            {
                writer.Write(string.Empty);
            }

            // Put to the info.
            info.AddValue("data", writer.ToArray());
        }
            public override void GetObjectData(SerializationInfo info, StreamingContext context)
            {
#if FAST_SERIALIZATION
                using (SerializationWriter writer = new SerializationWriter())
                {
                    writer.Write(_alias);
                    writer.Write(_characterMaximumLength);
                    writer.Write(_dataType);
                    writer.Write(_direction);
                    writer.Write(_enabled);
                    writer.Write(_isUserDefined);
                    writer.Write(_name);
                    writer.Write(_ordinalPosition);
                    writer.WriteObject(_userOptions);
                    writer.Write(_precision);
                    writer.Write(_scale);
                    info.AddValue("d", writer.ToArray());
                }
#else
                info.AddValue("SerializationVersion", SerializationVersion);
                info.AddValue("Alias", _alias);
                info.AddValue("CharacterMaximumLength", _characterMaximumLength);
                info.AddValue("DataType", _dataType);
                info.AddValue("Direction", _direction);
                info.AddValue("Enabled", _enabled);
                //info.AddValue("ExposedUserOptions", _exposedUserOptions);
                info.AddValue("IsUserDefined", _isUserDefined);
                info.AddValue("Name", _name);
                info.AddValue("OrdinalPosition", _ordinalPosition);
                info.AddValue("UserOptions", _userOptions);
                info.AddValue("Precision", _precision);
                info.AddValue("Scale", _scale);
#endif
            }
Esempio n. 10
0
        /// <summary>
        /// то же, что и GetHistoryOrders, но упаковано MarketOrderSerializer
        /// </summary>
        public RequestStatus GetHistoryOrdersCompressed(int?accountId, DateTime?startDate,
                                                        out byte[] buffer)
        {
            List <MarketOrder> orders;

            buffer = null;
            var retVal = GetHistoryOrders(accountId, startDate, out orders);

            if (orders != null && orders.Count > 0)
            {
                try
                {
                    using (var writer = new SerializationWriter())
                    {
                        writer.Write(orders);
                        writer.Flush();
                        buffer = writer.ToArray();
                    }
                }
                catch (Exception ex)
                {
                    Logger.Error("GetHistoryOrdersCompressed() - ошибка сериализации", ex);
                    return(RequestStatus.SerializationError);
                }
            }
            return(retVal);
        }
            public byte[] Serialize()
            {
                var _SerializationWriter = new SerializationWriter();
                _SerializationWriter.WriteUInt32(NumberOfQueueEntries);

                return _SerializationWriter.ToArray();
            }
        public static void ToObjectData(IFastSerializable obj, SerializationInfo info)
        {
            SerializationWriter writer = new SerializationWriter();

            obj.Serialize(writer);

            byte[] result = writer.ToArray();
            info.AddValue("fast$", Convert.ToBase64String(result));
        }
Esempio n. 13
0
 public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
 {
     using (SerializationWriter writer = new SerializationWriter())
     {
         writer.Write(_name);
         writer.WriteObject(_dataType);
         writer.WriteObject(_value);
         info.AddValue("d", writer.ToArray());
     }
 }
Esempio n. 14
0
		public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
		{
			using (SerializationWriter writer = new SerializationWriter())
			{
				writer.Write(_name);
				writer.WriteObject(_dataType);
				writer.WriteObject(_value);
				info.AddValue("d", writer.ToArray());
			}

		}
Esempio n. 15
0
        /// <summary>
        /// Implementing the ISerializable to provide a faster, more optimized
        /// serialization for the class.
        /// </summary>
        public void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            SerializationWriter writer = new SerializationWriter();

            writer.Write(_stampId);
            writer.WriteObject(_receiverId);
            writer.WriteObject(_senderId);

            // Put to the info.
            info.AddValue("data", writer.ToArray());
        }
		SerializationReader GetReaderFromWriter(SerializationWriter serializationWriter)
		{
			var data = serializationWriter.ToArray();

			if (writerLength == -1)
			{
				writerLength = data.Length;
			}

			return new SerializationReader(data);
		}
Esempio n. 17
0
        public void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            SerializationWriter writer = new SerializationWriter();

            writer.Write(Guid);
            writer.Write(Name);
            writer.Write(_messageBusIndex);

            // Put to the info.
            info.AddValue("data", writer.ToArray());
        }
Esempio n. 18
0
        /// <summary>
        /// Implementing the ISerializable to provide a faster, more optimized
        /// serialization for the class.
        /// </summary>
        public void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            SerializationWriter writer = new SerializationWriter();

            lock (_stamps)
            {
                writer.Write((object[])_stamps.ToArray());
            }

            // Put to the info.
            info.AddValue("data", writer.ToArray());
        }
Esempio n. 19
0
        public override void GetObjectData(SerializationInfo info, StreamingContext context)
        {
#if FAST_SERIALIZATION
            using (SerializationWriter writer = new SerializationWriter())
            {
                writer.Write(UniqueId);
                writer.Write(_alias);
                writer.Write(_aliasDisplay);
                writer.Write(_characterMaximumLength);
                writer.Write(_dataType);
                writer.Write(_default);
                writer.Write(_enabled);
                //writer.Write(_exposedUserOptions);
                writer.Write(_inPrimaryKey);
                writer.Write(_isIdentity);
                writer.Write(_isNullable);
                writer.Write(_isUserDefined);
                writer.Write(_name);
                writer.Write(_ordinalPosition);
                //writer.WriteObject(_parent);
                writer.Write(_readOnly);
                writer.WriteObject(_userOptions);
                writer.Write(_IsCalculated);
                writer.Write(_precision);
                writer.Write(_scale);
                info.AddValue("d", writer.ToArray());
            }
#else
            info.AddValue("SerializationVersion", SerializationVersion);
            info.AddValue("Alias", _alias);
            info.AddValue("AliasDisplay", _aliasDisplay);
            info.AddValue("CharacterMaximumLength", _characterMaximumLength);
            info.AddValue("DataType", _dataType);
            info.AddValue("Default", _default);
            info.AddValue("Enabled", _enabled);
            //info.AddValue("ExposedUserOptions", this._exposedUserOptions);
            info.AddValue("InPrimaryKey", _inPrimaryKey);
            info.AddValue("IsIdentity", _isIdentity);
            info.AddValue("IsNullable", _isNullable);
            info.AddValue("IsUserDefined", _isUserDefined);
            info.AddValue("Name", _name);
            info.AddValue("OrdinalPosition", _ordinalPosition);
            info.AddValue("Parent", _parent);
            info.AddValue("ReadOnly", _readOnly);
            info.AddValue("UserOptions", _userOptions);
            info.AddValue("IsCalculated", _IsCalculated);
            info.AddValue("Precision", _precision);
            info.AddValue("Scale", _scale);
            info.AddValue("Description", _description);
            info.AddValue("Lookup", _Lookup);
#endif
        }
Esempio n. 20
0
        public override void GetObjectData(SerializationInfo info, StreamingContext context)
        {
#if FAST_SERIALIZATION
            using (SerializationWriter writer = new SerializationWriter())
            {
                _ColumnsSortedByName = null;
                writer.Write(UniqueId);
                writer.Write(_alias);
                writer.Write(_aliasPlural);
                writer.WriteObject(_columns);
                //writer.WriteObject(_database);
                writer.Write(_enabled);
                //writer.Write(_exposedUserOptions);
                writer.WriteObject(_filters);
                writer.WriteObject(_indexes);
                writer.Write(_isUserDefined);
                writer.WriteObject(_keys);
                writer.WriteObject(_manyToManyRelationships);
                writer.WriteObject(_manyToOneRelationships);
                writer.Write(_name);
                writer.WriteObject(_oneToManyRelationships);
                writer.WriteObject(_oneToOneRelationships);
                writer.WriteObject(_userOptions);
                writer.Write(_Schema);
                writer.WriteObject(_Associations);
                //writer.Write(RelationshipStores);
                info.AddValue("d", writer.ToArray());
            }
#else
            info.AddValue("SerializationVersion", SerializationVersion);
            info.AddValue("Alias", _alias);
            info.AddValue("AliasPlural", _aliasPlural);
            info.AddValue("Columns", _columns);
            info.AddValue("Database", _database);
            info.AddValue("Enabled", _enabled);
            //info.AddValue("ExposedUserOptions", _exposedUserOptions);
            info.AddValue("Filters", _filters);
            info.AddValue("Indexes", _indexes);
            info.AddValue("IsUserDefined", _isUserDefined);
            info.AddValue("Keys", _keys);
            info.AddValue("ManyToManyRelationships", _manyToManyRelationships);
            info.AddValue("ManyToOneRelationships", _manyToOneRelationships);
            info.AddValue("Name", _name);
            info.AddValue("OneToManyRelationships", _oneToManyRelationships);
            info.AddValue("OneToOneRelationships", _oneToOneRelationships);
            info.AddValue("UserOptions", _userOptions);
            info.AddValue("Schema", _Schema);
            info.AddValue("Errors", _Errors);
            info.AddValue("Associations", _Associations);
            info.AddValue("Description", _description);
#endif
        }
Esempio n. 21
0
        public byte[] Serialize()
        {
            SerializationWriter writer = new SerializationWriter();

            writer.WriteObject(AccountName);
            writer.WriteObject(DeviceID);
			writer.WriteObject(Timestamp);
			writer.WriteObject(Latitude);
			writer.WriteObject(Longitude);
			writer.WriteObject(AccuracyInMeters);

            return writer.ToArray();
        }
Esempio n. 22
0
        public byte[] Serialize()
        {
            SerializationWriter writer = new SerializationWriter();

            writer.WriteObject(AccountName);
            writer.WriteObject(DeviceID);
            writer.WriteObject(Timestamp);
            writer.WriteObject(Latitude);
            writer.WriteObject(Longitude);
            writer.WriteObject(AccuracyInMeters);

            return(writer.ToArray());
        }
Esempio n. 23
0
        /// <summary>
        /// Implementing the ISerializable to provide a faster, more optimized
        /// serialization for the class.
        /// </summary>
        public void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            SerializationWriter writer = new SerializationWriter();

            writer.Write((int)_duplicationMode);
            writer.Write((int)_executionModel);
            writer.WriteObject(_message);
            writer.WriteObject(_transportHistory);
            writer.WriteObject(_transportTargetAddress);

            // Put to the info.
            info.AddValue("data", writer.ToArray());
        }
        /// <summary>
        /// this method serializes the Input object into a byte array data stream. Every public member variable that
        /// does not have the NotFastSerializable attribut will be serialized
        /// </summary>
        /// <param name="Input">the Input object</param>
        /// <returns>a byte array containing the data stream</returns>
        public byte[] Serialize(T Input)
        {
            Type          reflectiontype = typeof(T);
            MD5           MD5CheckSum    = MD5.Create();
            StringBuilder HashString     = new StringBuilder();
            // warm up the FastSerializerEngine...
            SerializationWriter writer = new SerializationWriter();

            bool serialize = true;

            // reflect the given object...
            foreach (FieldInfo field in reflectiontype.GetFields())
            {
                if (field.IsPublic)
                {
                    serialize = true;
                    #region Check for NotFastSerializable Attribute
                    foreach (Attribute attr in field.GetCustomAttributes(true))
                    {
                        NotFastSerializable tattr = attr as NotFastSerializable;
                        if (null != tattr)
                        {
                            serialize = false;
                            break;
                        }
                    }
                    #endregion
                    if (serialize)
                    {
                        HashString = HashString.Append(field.FieldType.ToString());

                        object fieldvalue = field.GetValue(Input);
                        // SerializedSuperblock it to the serializer stream
                        writer.WriteObject(fieldvalue);
                    }
                }
            }

            // build the final byte array

            byte[] HashValue       = MD5CheckSum.ComputeHash(Encoding.UTF8.GetBytes(HashString.ToString()));
            byte[] SerializedBytes = writer.ToArray();

            byte[] Result = new byte[HashValue.Length + SerializedBytes.Length];
            Array.Copy(HashValue, 0, Result, 0, HashValue.Length);
            Array.Copy(SerializedBytes, 0, Result, HashValue.Length, SerializedBytes.Length);


            // return the values...
            return(Result);
        }
Esempio n. 25
0
        public override void GetObjectData(SerializationInfo info, StreamingContext context)
        {
#if FAST_SERIALIZATION
            using (SerializationWriter writer = new SerializationWriter())
            {
                writer.Write(UniqueId);
                writer.Write(_alias);
                writer.Write(_aliasDisplay);
                writer.Write(_characterMaximumLength);
                //writer.WriteObject(_currentParent);
                writer.Write(_dataType);
                writer.Write(_default);
                writer.Write(_enabled);
                writer.Write(ForeignColumn.UniqueId);
                writer.Write(_inPrimaryKey);
                writer.Write(_isIdentity);
                writer.Write(_isNullable);
                writer.Write(_isUserDefined);
                writer.Write(_name);
                writer.Write(_ordinalPosition);
                //writer.WriteObject(_parent);
                writer.Write(_readOnly);
                //writer.WriteTokenizedObject(_relationshipPath);
                writer.Write(ScriptBase.GetUniqueIds(RelationshipPath));
                writer.WriteObject(_userOptions);
                info.AddValue("d", writer.ToArray());
            }
#else
            info.AddValue("SerializationVersion", SerializationVersion);
            info.AddValue("Alias", _alias);
            info.AddValue("AliasDisplay", _aliasDisplay);
            info.AddValue("CharacterMaximumLength", _characterMaximumLength);
            info.AddValue("CurrentParent", _currentParent);
            info.AddValue("DataType", _dataType);
            info.AddValue("Default", _default);
            info.AddValue("Enabled", _enabled);
            //info.AddValue("ExposedUserOptions", _exposedUserOptions);
            info.AddValue("ForeignColumn", _foreignColumn);
            info.AddValue("InPrimaryKey", _inPrimaryKey);
            info.AddValue("IsIdentity", _isIdentity);
            info.AddValue("IsNullable", _isNullable);
            info.AddValue("IsUserDefined", _isUserDefined);
            info.AddValue("Name", _name);
            info.AddValue("OrdinalPosition", _ordinalPosition);
            info.AddValue("Parent", _parent);
            info.AddValue("ReadOnly", _readOnly);
            info.AddValue("RelationshipPath", _relationshipPath);
            info.AddValue("UserOptions", _userOptions);
            info.AddValue("Description", _description);
#endif
        }
            public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
            {
#if FAST_SERIALIZATION
                using (SerializationWriter writer = new SerializationWriter())
                {
                    writer.Write(_Version);
                    writer.WriteObject(Databases);
                    info.AddValue("d", writer.ToArray());
                }
#else
                info.AddValue("Version", _Version);
                info.AddValue("Databases", Databases);
#endif
            }
Esempio n. 27
0
        public byte[] Serialize()
        {
            SerializationWriter writer = new SerializationWriter();

            writer.WriteObject(CreationTime);
            writer.WriteObject(Start);
            writer.WriteObject(End);

            // align it...
            byte[] Output = new byte[33];
            writer.ToArray().CopyTo(Output, 0);

            return(Output);
        }
Esempio n. 28
0
            public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
            {
#if FAST_SERIALIZATION
                using (SerializationWriter writer = new SerializationWriter())
                {
                    writer.Write(Column.UniqueId);
                    writer.Write(_sortOperator);
                    info.AddValue("d", writer.ToArray());
                }
#else
                info.AddValue("Column", _column);
                info.AddValue("SortOperator", _sortOperator);
#endif
            }
Esempio n. 29
0
        public override void GetObjectData(SerializationInfo info, StreamingContext context)
        {
#if FAST_SERIALIZATION
            using (SerializationWriter writer = new SerializationWriter())
            {
                foreach (FilterColumn col in _filterColumns)
                {
                    col.Parent = this;
                }
                writer.Write(UniqueId);
                writer.Write(_alias);
                writer.Write(_createStoredProcedure);
                writer.Write(_customWhere);
                writer.Write(_enabled);
                //writer.WriteObject(_exposedUserOptions);
                writer.WriteObject(_filterColumns);
                writer.Write(_isReturnTypeCollection);
                writer.Write(_isUserDefined);
                writer.Write(_name);
                writer.WriteObject(_orderByColumns);
                //writer.WriteObject(_parent);
                writer.Write(_useCustomWhere);
                writer.WriteObject(_userOptions);
                info.AddValue("d", writer.ToArray());
            }
            info.AddValue("UserOptions", this._userOptions);
#else
            info.AddValue("SerializationVersion", SerializationVersion);
            info.AddValue("Alias", _alias);
            info.AddValue("CreateStoredProcedure", _createStoredProcedure);
            info.AddValue("CustomWhere", _customWhere);
            info.AddValue("Enabled", _enabled);
            info.AddValue("FilterColumns", _filterColumns);
            info.AddValue("IsReturnTypeCollection", _isReturnTypeCollection);
            info.AddValue("IsUserDefined", _isUserDefined);
            info.AddValue("Name", _name);
            info.AddValue("OrderByColumns", _orderByColumns);
            info.AddValue("Parent", _parent);
            info.AddValue("UserCustomWhere", _useCustomWhere);
            info.AddValue("UserOptions", _userOptions);
            info.AddValue("Description", _description);
#endif
        }
        public override void GetObjectData(SerializationInfo info, StreamingContext context)
        {
#if FAST_SERIALIZATION
            using (SerializationWriter writer = new SerializationWriter())
            {
                writer.Write(UniqueId);
                writer.Write(_alias);
                writer.Write(_enabled);
                //writer.Write(_exposedUserOptions);
                writer.Write(Filter.UniqueId);
                //writer.Write(_foreignColumns);
                writer.Write(ScriptBase.GetUniqueIds(ForeignColumns));
                writer.Write(ForeignRelationship.UniqueId);
                writer.Write(ForeignScriptObject.UniqueId);
                writer.Write(_isBase);
                writer.Write(_isUserDefined);
                writer.Write(_name);
                //writer.WriteObject(_parent);
                //writer.Write(_primaryColumns);
                writer.Write(ScriptBase.GetUniqueIds(PrimaryColumns));
                //writer.WriteObject(_primaryScriptObject);
                writer.WriteObject(_userOptions);
                info.AddValue("d", writer.ToArray());
            }
#else
            info.AddValue("SerializationVersion", SerializationVersion);
            info.AddValue("Alias", _alias);
            info.AddValue("Enabled", _enabled);
            //info.AddValue("ExposedUserOptions", _exposedUserOptions);
            info.AddValue("Filter", _filter);
            info.AddValue("ForeignColumns", _foreignColumns);
            info.AddValue("ForeignRelationship", _foreignRelationship);
            info.AddValue("ForeignScriptObject", _foreignScriptObject);
            info.AddValue("IsBase", _isBase);
            info.AddValue("IsUserDefined", _isUserDefined);
            info.AddValue("Name", _name);
            info.AddValue("Parent", _parent);
            info.AddValue("PrimaryColumns", _primaryColumns);
            info.AddValue("PrimaryScriptObject", _primaryScriptObject);
            info.AddValue("UserOptions", _userOptions);
            info.AddValue("Description", _description);
#endif
        }
Esempio n. 31
0
        public override RequestStatus GetHistoryOrdersCompressed(int?accountId, DateTime?startDate, out byte[] buffer)
        {
            buffer = null;
            List <MarketOrder> ordlist;
            var status = GetHistoryOrders(accountId, startDate, out ordlist);

            if (ordlist == null || ordlist.Count == 0)
            {
                return(status);
            }

            using (var writer = new SerializationWriter())
            {
                writer.Write(orders);
                writer.Flush();
                buffer = writer.ToArray();
            }

            return(status);
        }
Esempio n. 32
0
        public byte[] Serialize()
        {
            SerializationWriter writer = new SerializationWriter();

            writer.WriteObject(ServerName);
            writer.WriteObject(Name);
            if (Type == ObjectTypes.Actor)
                writer.WriteObject((byte)0);
            else
            if (Type == ObjectTypes.Sensor)
                writer.WriteObject((byte)1);
            else
            if (Type == ObjectTypes.Unknown)
                writer.WriteObject((byte)2);

            writer.WriteObject(TypeName);
            writer.WriteObject(Timecode.Ticks);
            writer.WriteObject(XS1ObjectID);
            writer.WriteObject(Value);

            return writer.ToArray();
        }
Esempio n. 33
0
        public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
        {
#if FAST_SERIALIZATION
            using (SerializationWriter writer = new SerializationWriter())
            {
                writer.WriteObject(_connectionString);
                writer.WriteObject(_databaseType);
                writer.Write(_name);
                writer.WriteObject(_storedProcedures);
                writer.WriteObject(_tables);
                writer.WriteObject(_views);
                info.AddValue("d", writer.ToArray());
            }
#else
            info.AddValue("SerializationVersion", Model.ScriptBase.SerializationVersion);
            info.AddValue("ConnectionString", _connectionString);
            info.AddValue("DatabaseType", _databaseType);
            info.AddValue("Name", _name);
            info.AddValue("StoredProcedures", _storedProcedures);
            info.AddValue("Tables", _tables);
            info.AddValue("Views", _views);
            info.AddValue("Lookups", _lookups);
#endif
        }
Esempio n. 34
0
 public override void GetObjectData(SerializationInfo info, StreamingContext context)
 {
     #if FAST_SERIALIZATION
     using (SerializationWriter writer = new SerializationWriter())
     {
         writer.Write(UniqueId);
         writer.Write(_alias);
         writer.Write(_aliasDisplay);
         writer.Write(_characterMaximumLength);
         //writer.WriteObject(_currentParent);
         writer.Write(_dataType);
         writer.Write(_default);
         writer.Write(_enabled);
         writer.Write(ForeignColumn.UniqueId);
         writer.Write(_inPrimaryKey);
         writer.Write(_isIdentity);
         writer.Write(_isNullable);
         writer.Write(_isUserDefined);
         writer.Write(_name);
         writer.Write(_ordinalPosition);
         //writer.WriteObject(_parent);
         writer.Write(_readOnly);
         //writer.WriteTokenizedObject(_relationshipPath);
         writer.Write(ScriptBase.GetUniqueIds(RelationshipPath));
         writer.WriteObject(_userOptions);
         info.AddValue("d", writer.ToArray());
     }
     #else
     info.AddValue("SerializationVersion", SerializationVersion);
     info.AddValue("Alias", _alias);
     info.AddValue("AliasDisplay", _aliasDisplay);
     info.AddValue("CharacterMaximumLength", _characterMaximumLength);
     info.AddValue("CurrentParent", _currentParent);
     info.AddValue("DataType", _dataType);
     info.AddValue("Default", _default);
     info.AddValue("Enabled", _enabled);
     //info.AddValue("ExposedUserOptions", _exposedUserOptions);
     info.AddValue("ForeignColumn", _foreignColumn);
     info.AddValue("InPrimaryKey", _inPrimaryKey);
     info.AddValue("IsIdentity", _isIdentity);
     info.AddValue("IsNullable", _isNullable);
     info.AddValue("IsUserDefined", _isUserDefined);
     info.AddValue("Name", _name);
     info.AddValue("OrdinalPosition", _ordinalPosition);
     info.AddValue("Parent", _parent);
     info.AddValue("ReadOnly", _readOnly);
     info.AddValue("RelationshipPath", _relationshipPath);
     info.AddValue("UserOptions", _userOptions);
     info.AddValue("Description", _description);
     #endif
 }
Esempio n. 35
0
 public override void GetObjectData(SerializationInfo info, StreamingContext context)
 {
     #if FAST_SERIALIZATION
     using (SerializationWriter writer = new SerializationWriter())
     {
         writer.Write(UniqueId);
         writer.Write(_alias);
         //writer.Write(_columns);
         writer.Write(ScriptBase.GetUniqueIds(Columns));
         writer.Write(_enabled);
         //writer.WriteObject(_exposedUserOptions);
         writer.Write(_isUserDefined);
         writer.Write(_name);
         //writer.WriteObject(_parent);
         writer.Write(_type);
         writer.WriteObject(_userOptions);
         info.AddValue("d", writer.ToArray());
     }
     #else
     info.AddValue("SerializationVersion", SerializationVersion);
     info.AddValue("Alias", _alias);
     info.AddValue("Columns", _columns);
     info.AddValue("Enabled", _enabled);
     //info.AddValue("ExposedUserOptions", this._exposedUserOptions);
     info.AddValue("IsUserDefined", _isUserDefined);
     info.AddValue("Name", _name);
     info.AddValue("Parent", _parent);
     info.AddValue("Type", _type);
     info.AddValue("UserOptions", _userOptions);
     info.AddValue("Description", _description);
     #endif
 }
Esempio n. 36
0
        /// <summary>
        /// Implementing the ISerializable to provide a faster, more optimized
        /// serialization for the class.
        /// </summary>
        public void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            SerializationWriter writer = new SerializationWriter();

            writer.Write(_stampId);
            writer.WriteObject(_receiverId);
            writer.WriteObject(_senderId);

            // Put to the info.
            info.AddValue("data", writer.ToArray());
        }
            public byte[] Serialize()
            {
                var _SerializationWriter = new SerializationWriter();
                _SerializationWriter.WriteString(ObjectLocation);
                _SerializationWriter.WriteString(UserMetadataKey);
                _SerializationWriter.WriteInt32(NumberOfRevisions);

                return _SerializationWriter.ToArray();
            }
Esempio n. 38
0
            public Byte[] Serialize()
            {
                SerializationWriter writer = new SerializationWriter();

                writer.WriteString(ServiceGlobalUniqueName);
                writer.WriteString(ServiceUri.ToString());
                writer.WriteByte((Byte)ServiceType);

                return writer.ToArray();
            }
Esempio n. 39
0
        public byte[] Serialize()
        {
            #region Data

            SerializationWriter writer;

            writer = new SerializationWriter();

            #endregion

            #region Write Basics

            try
            {
                writer.WriteString(Name);
                writer.WriteString(Description);
                OwnerID.Serialize(ref writer);
                Type.Serialize(ref writer);
                writer.WriteObject(Default.Value);
                writer.WriteObject(_Value.Value);

                _isDirty = false;
            }
            catch (SerializationException e)
            {
                throw new SerializationException(e.Message);
            }

            #endregion

            return writer.ToArray();
        }
Esempio n. 40
0
 public override void GetObjectData(SerializationInfo info, StreamingContext context)
 {
     #if FAST_SERIALIZATION
     using (SerializationWriter writer = new SerializationWriter())
     {
         _ColumnsSortedByName = null;
         int i = _database.StoredProcedures.Length;
         writer.Write(UniqueId);
         writer.Write(_alias);
         writer.Write(_aliasPlural);
         writer.WriteObject(_columns);
         //writer.WriteObject(_database);
         writer.Write(_enabled);
         writer.WriteObject(_filters);
         writer.Write(_isUserDefined);
         writer.WriteObject(_manyToManyRelationships);
         writer.WriteObject(_manyToOneRelationships);
         writer.Write(_name);
         writer.WriteObject(_oneToManyRelationships);
         writer.WriteObject(_oneToOneRelationships);
         writer.WriteObject(_parameters);
         writer.WriteObject(_userOptions);
         writer.Write(_Schema);
         writer.WriteObject(_Associations);
         info.AddValue("d", writer.ToArray());
     }
     #else
     info.AddValue("SerializationVersion", SerializationVersion);
     info.AddValue("Alias", _alias);
     info.AddValue("AliasPlural", _aliasPlural);
     info.AddValue("Columns", _columns);
     info.AddValue("Database", _database);
     info.AddValue("Enabled", _enabled);
     //info.AddValue("ExposedUserOptions", _exposedUserOptions);
     info.AddValue("Filters", _filters);
     info.AddValue("IsUserDefined", _isUserDefined);
     info.AddValue("ManyToManyRelationships", _manyToManyRelationships);
     info.AddValue("ManyToOneRelationships", _manyToOneRelationships);
     info.AddValue("Name", _name);
     info.AddValue("OneToManyRelationships", _oneToManyRelationships);
     info.AddValue("OneToOneRelationships", _oneToOneRelationships);
     info.AddValue("Parameters", _parameters);
     info.AddValue("UserOptions", _userOptions);
     info.AddValue("Schema", _Schema);
     info.AddValue("Errors", _Errors);
     info.AddValue("Associations", _Associations);
     info.AddValue("Description", _description);
     #endif
 }
Esempio n. 41
0
        /// <summary>
        /// Implementing the ISerializable to provide a faster, more optimized
        /// serialization for the class.
        /// </summary>
        /// <param name="info"></param>
        /// <param name="context"></param>
        public void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            SerializationWriter writer = new SerializationWriter();

            writer.Write(Id);
            writer.Write((int)State);
            writer.Write(RequestResponse);
            writer.Write(Parameters);

            // It is possible to not be able to construct method info here;
            // in this case we shall only contain the name, since we may
            // need it later on.
            if (MethodInfoLocal != null)
            {
                writer.Write(SerializationHelper.SerializeMethodBaseToString(MethodInfoLocal, true));
            }
            else if (string.IsNullOrEmpty(_methodInfoName) == false)
            {
                writer.Write(_methodInfoName);
            }
            else
            {
                writer.Write(string.Empty);
            }

            // Put to the info.
            info.AddValue("data", writer.ToArray());
        }
            public Byte[] Serialize()
            {
                var _SerializationWriter = new SerializationWriter();

                _SerializationWriter.WriteString(ObjectLocation);
                _SerializationWriter.WriteByte(NewDefaultRule);

                return _SerializationWriter.ToArray();
            }
            public byte[] Serialize()
            {
                var _SerializationWriter = new SerializationWriter();
                _SerializationWriter.WriteString(ObjectLocation);
                _SerializationWriter.WriteType(GraphObjectType);

                return _SerializationWriter.ToArray();
            }
            public byte[] Serialize()
            {
                var _SerializationWriter = new SerializationWriter();
                _SerializationWriter.WriteString(ObjectLocation);
                _SerializationWriter.WriteType(TypeOfCacheEntry);

                return _SerializationWriter.ToArray();
            }
Esempio n. 45
0
 public override void GetObjectData(SerializationInfo info, StreamingContext context)
 {
     #if FAST_SERIALIZATION
     using (SerializationWriter writer = new SerializationWriter())
     {
         writer.Write(UniqueId);
         writer.Write(_alias);
         writer.Write(_aliasDisplay);
         writer.Write(_characterMaximumLength);
         writer.Write(_dataType);
         writer.Write(_default);
         writer.Write(_enabled);
         //writer.Write(_exposedUserOptions);
         writer.Write(_inPrimaryKey);
         writer.Write(_isIdentity);
         writer.Write(_isNullable);
         writer.Write(_isUserDefined);
         writer.Write(_name);
         writer.Write(_ordinalPosition);
         //writer.WriteObject(_parent);
         writer.Write(_readOnly);
         writer.WriteObject(_userOptions);
         writer.Write(_IsCalculated);
         writer.Write(_precision);
         writer.Write(_scale);
         info.AddValue("d", writer.ToArray());
     }
     #else
     info.AddValue("SerializationVersion", SerializationVersion);
     info.AddValue("Alias", _alias);
     info.AddValue("AliasDisplay", _aliasDisplay);
     info.AddValue("CharacterMaximumLength", _characterMaximumLength);
     info.AddValue("DataType", _dataType);
     info.AddValue("Default", _default);
     info.AddValue("Enabled", _enabled);
     //info.AddValue("ExposedUserOptions", this._exposedUserOptions);
     info.AddValue("InPrimaryKey", _inPrimaryKey);
     info.AddValue("IsIdentity", _isIdentity);
     info.AddValue("IsNullable", _isNullable);
     info.AddValue("IsUserDefined", _isUserDefined);
     info.AddValue("Name", _name);
     info.AddValue("OrdinalPosition", _ordinalPosition);
     info.AddValue("Parent", _parent);
     info.AddValue("ReadOnly", _readOnly);
     info.AddValue("UserOptions", _userOptions);
     info.AddValue("IsCalculated", _IsCalculated);
     info.AddValue("Precision", _precision);
     info.AddValue("Scale", _scale);
     info.AddValue("Description", _description);
     info.AddValue("Lookup", _Lookup);
     #endif
 }
Esempio n. 46
0
        /// <summary>
        /// This will serialize the whole AFSObject including the common header of an
        /// AAFSObject and the actual AFSObject
        /// </summary>
        /// <param name="myIntegrityCheckAlgorithm"></param>
        /// <param name="myEncryptionAlgorithm"></param>
        /// <param name="myCacheSerializeData"></param>
        /// <returns></returns>
        public Byte[] Serialize(IIntegrityCheck myIntegrityCheckAlgorithm, ISymmetricEncryption myEncryptionAlgorithm, Boolean myCacheSerializeData)
        {
            #region Data

            Int32 IntegrityCheckValue_Length = 0;
            Byte[] IntegrityCheckValue = null;
            Int64 IntegrityCheckValue_Position = 0;

            Int32 EncryptionParameters_Length = 0;
            Byte DataPadding_Length = 0;
            Int32 AdditionalPadding_Length = 0;
            Byte[] _TmpSerializedAGraphStructure = null;

            #endregion

            try
            {

                #region Init SerializationWriter

                SerializationWriter writer = new SerializationWriter();

                #endregion

                #region Pad the length of the EncryptionParameters

                EncryptionParameters = Encoding.Default.GetBytes("-HIGHSECUREDATA-");
                EncryptionParameters_Length = sones.Lib.BufferHelper.AlignBufferLength(EncryptionParameters.Length, 8);

                #endregion

                #region Serialize AAFSObjectHeader

                Byte[] AAFSObjectHeader = new Byte[HeaderLength];

                AAFSObjectHeader[0] = HeaderVersion;

                if (myIntegrityCheckAlgorithm != null)
                    IntegrityCheckValue_Length = myIntegrityCheckAlgorithm.HashSize;

                if (IntegrityCheckValue_Length % 8 == 0)
                    AAFSObjectHeader[1] = (Byte)(IntegrityCheckValue_Length / 8);
                else AAFSObjectHeader[1] = (Byte)((IntegrityCheckValue_Length / 8) + 1);

                if (EncryptionParameters_Length % 8 == 0)
                    AAFSObjectHeader[2] = (Byte)(EncryptionParameters_Length / 8);
                else AAFSObjectHeader[2] = (Byte)((EncryptionParameters_Length / 8) + 1);

                AAFSObjectHeader[3] = (Byte)(DataPadding_Length);
                AAFSObjectHeader[4] = (Byte)(AdditionalPadding_Length / 256);
                AAFSObjectHeader[5] = (Byte)(AdditionalPadding_Length % 256);
                AAFSObjectHeader[6] = 0x00;
                AAFSObjectHeader[7] = 0x00;

                writer.WriteBytesDirect(AAFSObjectHeader);                      // 8 Bytes
                IntegrityCheckValue_Position = writer.BaseStream.Position;
                writer.WriteBytesDirect(new Byte[IntegrityCheckValue_Length]);      // n or at least 16 Bytes
                writer.WriteBytesDirect(EncryptionParameters);                      // m Bytes

                #endregion

                #region Serialize StructureVersion, ObjectUUID and the Inner Object

                writer.WriteBytesDirect(BitConverter.GetBytes(_StructureVersion));
                ObjectUUID.Serialize(ref writer);        // n or at least 16 Bytes

                Serialize(ref writer);

                #endregion

                _TmpSerializedAGraphStructure = writer.ToArray();

                #region Encrypt
                #endregion

                #region Add IntegrityCheck

                if (myIntegrityCheckAlgorithm != null && IntegrityCheckValue_Length > 0)
                {

                    IntegrityCheckValue = myIntegrityCheckAlgorithm.GetHashValueAsByteArray(_TmpSerializedAGraphStructure);

                    // If the returned array is shorter than expected => pad with 0x00
                    // And if it is longer just copy the number of expected bytes
                    Array.Copy(IntegrityCheckValue, 0, _TmpSerializedAGraphStructure, IntegrityCheckValue_Position, IntegrityCheckValue.Length);

                }

                #endregion

                isDirty = false;

                if (myCacheSerializeData)
                    _SerializedAGraphStructure = _TmpSerializedAGraphStructure;

                return _TmpSerializedAGraphStructure;

            }

            catch (SerializationException e)
            {
                throw new SerializationException(e.Message, e);
            }
        }
Esempio n. 47
0
 public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
 {
     #if FAST_SERIALIZATION
     using (SerializationWriter writer = new SerializationWriter())
     {
         writer.Write(_Version);
         writer.WriteObject(Databases);
         info.AddValue("d", writer.ToArray());
     }
     #else
     info.AddValue("Version", _Version);
     info.AddValue("Databases", Databases);
     #endif
 }
Esempio n. 48
0
 public override void GetObjectData(SerializationInfo info, StreamingContext context)
 {
     #if FAST_SERIALIZATION
     using (SerializationWriter writer = new SerializationWriter())
     {
         writer.Write(_alias);
         writer.Write(_characterMaximumLength);
         writer.Write(_dataType);
         writer.Write(_direction);
         writer.Write(_enabled);
         writer.Write(_isUserDefined);
         writer.Write(_name);
         writer.Write(_ordinalPosition);
         writer.WriteObject(_userOptions);
         writer.Write(_precision);
         writer.Write(_scale);
         info.AddValue("d", writer.ToArray());
     }
     #else
     info.AddValue("SerializationVersion", SerializationVersion);
     info.AddValue("Alias", _alias);
     info.AddValue("CharacterMaximumLength", _characterMaximumLength);
     info.AddValue("DataType", _dataType);
     info.AddValue("Direction", _direction);
     info.AddValue("Enabled", _enabled);
     //info.AddValue("ExposedUserOptions", _exposedUserOptions);
     info.AddValue("IsUserDefined", _isUserDefined);
     info.AddValue("Name", _name);
     info.AddValue("OrdinalPosition", _ordinalPosition);
     info.AddValue("UserOptions", _userOptions);
     info.AddValue("Precision", _precision);
     info.AddValue("Scale", _scale);
     #endif
 }
Esempio n. 49
0
        public static void ToObjectData(IFastSerializable obj, SerializationInfo info)
        {
            SerializationWriter writer = new SerializationWriter();

            obj.Serialize(writer);

            byte[] result = writer.ToArray();
            info.AddValue("fast$", Convert.ToBase64String(result));
        }
Esempio n. 50
0
        private byte[] Serialize(ref SerializationWriter mySerializationWriter, ADBSettingsBase myValue)
        {
            #region Write Basics

            try
            {
                if (myValue != null)
                {
                    mySerializationWriter.WriteString(myValue.Name);
                    mySerializationWriter.WriteString(myValue.Description);
                    mySerializationWriter.WriteObject(myValue.OwnerID);
                    myValue.Type.Serialize(ref mySerializationWriter);
                    mySerializationWriter.WriteObject(myValue.Default.Value);
                    mySerializationWriter.WriteObject(myValue._Value.Value);

                    _isDirty = false;
                }
                else
                {
                    mySerializationWriter.WriteString(Name);
                    mySerializationWriter.WriteString(Description);
                    mySerializationWriter.WriteObject(myValue.OwnerID);
                    myValue.Type.Serialize(ref mySerializationWriter);
                    mySerializationWriter.WriteObject(Default.Value);
                    mySerializationWriter.WriteObject(_Value.Value);
                }
            }
            catch (SerializationException e)
            {
                throw new SerializationException(e.Message);
            }

            #endregion

            return mySerializationWriter.ToArray();
        }
Esempio n. 51
0
            public Byte[] Serialize()
            {
                var _SerializationWriter = new SerializationWriter();

                _SerializationWriter.WriteString(ObjectLocation.ToString());
                _SerializationWriter.WriteString(ObjectStream);
                _SerializationWriter.WriteString(ObjectEdition);
                _SerializationWriter.WriteString(ObjectRevisionID.ToString());

                return _SerializationWriter.ToArray();
            }
 public override void GetObjectData(SerializationInfo info, StreamingContext context)
 {
     #if FAST_SERIALIZATION
     using (SerializationWriter writer = new SerializationWriter())
     {
         writer.Write(UniqueId);
         writer.Write(_alias);
         writer.Write(_enabled);
         //writer.Write(_exposedUserOptions);
         writer.Write(Filter.UniqueId);
         //writer.Write(_foreignColumns);
         writer.Write(ScriptBase.GetUniqueIds(ForeignColumns));
         writer.Write(ForeignRelationship.UniqueId);
         writer.Write(ForeignScriptObject.UniqueId);
         writer.Write(_isUserDefined);
         writer.Write(_name);
         //writer.WriteObject(_parent);
         //writer.Write(_primaryColumns);
         writer.Write(ScriptBase.GetUniqueIds(PrimaryColumns));
         //writer.WriteObject(_primaryScriptObject);
         writer.WriteObject(_userOptions);
         info.AddValue("d", writer.ToArray());
     }
     #else
     info.AddValue("SerializationVersion", SerializationVersion);
     info.AddValue("Alias", _alias);
     info.AddValue("Enabled", _enabled);
     //info.AddValue("ExposedUserOptions", _exposedUserOptions);
     info.AddValue("Filter", _filter);
     info.AddValue("ForeignColumns", _foreignColumns);
     info.AddValue("ForeignRelationship", _foreignRelationship);
     info.AddValue("ForeignScriptObject", _foreignScriptObject);
     info.AddValue("IsUserDefined", _isUserDefined);
     info.AddValue("Name", _name);
     info.AddValue("Parent", _parent);
     info.AddValue("PrimaryColumns", _primaryColumns);
     info.AddValue("PrimaryScriptObject", _primaryScriptObject);
     info.AddValue("UserOptions", _userOptions);
     info.AddValue("Description", _description);
     #endif
 }
            public byte[] Serialize()
            {
                var _SerializationWriter = new SerializationWriter();
                _SerializationWriter.WriteObject(CachedItemKeysToFlush);

                return _SerializationWriter.ToArray();
            }
Esempio n. 54
0
        /// <summary>
        /// Implementing the ISerializable to provide a faster, more optimized
        /// serialization for the class.
        /// </summary>
        public void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            SerializationWriter writer = new SerializationWriter();

            lock (_stamps)
            {
                writer.Write((object[])_stamps.ToArray());
            }

            // Put to the info.
            info.AddValue("data", writer.ToArray());
        }
            public Byte[] Serialize()
            {
                var writer = new SerializationWriter();

                writer.WriteString(ObjectLocation);
                RightUUID.Serialize(ref writer);
                EntitiyUUID.Serialize(ref writer);

                return writer.ToArray();
            }
Esempio n. 56
0
            public byte[] Serialize()
            {
                var _SerializationWriter = new SerializationWriter();
                if (StorageURIs == null)
                    _SerializationWriter.WriteUInt32(0);
                else
                    _SerializationWriter.WriteUInt32((UInt32)StorageURIs.Count);

                foreach (String uri in StorageURIs)
                    _SerializationWriter.WriteString(uri);

                _SerializationWriter.WriteString(StorageType);
                _SerializationWriter.WriteUInt64(StorageSize);

                return _SerializationWriter.ToArray();
            }
            public byte[] Serialize()
            {
                var _SerializationWriter = new SerializationWriter();
                _SerializationWriter.WriteInt32(FailedCopy);
                _SerializationWriter.WriteInt32(MaxNumberOfCopies);
                _SerializationWriter.Write(SerializedObjectStream);

                return _SerializationWriter.ToArray();
            }