当前位置: 首页>>代码示例>>C#>>正文


C# SerializationReader.ReadObject方法代码示例

本文整理汇总了C#中SerializationReader.ReadObject方法的典型用法代码示例。如果您正苦于以下问题:C# SerializationReader.ReadObject方法的具体用法?C# SerializationReader.ReadObject怎么用?C# SerializationReader.ReadObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SerializationReader的用法示例。


在下文中一共展示了SerializationReader.ReadObject方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DeserializeStateBag

        public static StateBag DeserializeStateBag(SerializationReader reader)
        {
            var flags = reader.ReadOptimizedBitVector32();
            var stateBag = new StateBag(flags[StateBagIsIgnoreCase]);

            if (flags[StateBagHasDirtyEntries])
            {
                var count = reader.ReadOptimizedInt32();

                for(var i = 0; i < count; i++)
                {
                    var key = reader.ReadOptimizedString();
                    var value = reader.ReadObject();

            // ReSharper disable PossibleNullReferenceException
                    stateBag.Add(key, value).IsDirty = true;
            // ReSharper restore PossibleNullReferenceException
                }
            }

            if (flags[StateBagHasCleanEntries])
            {
                var count = reader.ReadOptimizedInt32();

                for(var i = 0; i < count; i++)
                {
                    var key = reader.ReadOptimizedString();
                    var value = reader.ReadObject();

                    stateBag.Add(key, value);
                }
            }
            return stateBag;
        }
开发者ID:bbqchickenrobot,项目名称:FastSerializer,代码行数:34,代码来源:WebFastSerializationHelper.cs

示例2: EnvelopeStamp

        /// <summary>
        /// Implementing the ISerializable to provide a faster, more optimized
        /// serialization for the class.
        /// </summary>
        public EnvelopeStamp(SerializationInfo info, StreamingContext context)
        {
            // Get from the info.
            SerializationReader reader = new SerializationReader((byte[])info.GetValue("data", typeof(byte[])));

            _stampId = reader.ReadInt64();
            _receiverId = (ClientId)reader.ReadObject();
            _senderId = (ClientId)reader.ReadObject();
        }
开发者ID:paralin,项目名称:SuperPool,代码行数:13,代码来源:EnvelopeStamp.cs

示例3: Envelope

        /// <summary>
        /// Implementing the ISerializable to provide a faster, more optimized
        /// serialization for the class using the fast serialization elements.
        /// </summary>
        public Envelope(SerializationInfo info, StreamingContext context)
        {
            // Get from the info.
            SerializationReader reader = new SerializationReader((byte[])info.GetValue("data", typeof(byte[])));

            _duplicationMode = (DuplicationModeEnum)reader.ReadInt32();
            _executionModel = (ExecutionModelEnum)reader.ReadInt32();
            _message = reader.ReadObject();
            _transportHistory = (EnvelopeTransportation)reader.ReadObject();
            _transportTargetAddress = (EnvelopeTransportation)reader.ReadObject();
        }
开发者ID:paralin,项目名称:SuperPool,代码行数:15,代码来源:Envelope.cs

示例4: Deserialize

            public void Deserialize(byte[] mySerializedBytes)
            {
                SerializationReader reader = new SerializationReader(mySerializedBytes);

                ServiceGlobalUniqueName = (String)reader.ReadObject();
                String _ServiceUri   = (String)reader.ReadObject();
                ServiceType = (DiscoverableServiceType)reader.ReadObject();

                if (!Uri.TryCreate(_ServiceUri,UriKind.Absolute,out ServiceUri))
                    throw new NotificationException_InvalidNotificationPayload("IP not parseable. Notification Packet invalid!");
            }
开发者ID:TheByte,项目名称:sones,代码行数:11,代码来源:NSD_Filesystem.cs

示例5: Association

 public Association(SerializationInfo serializationInfo, StreamingContext streamingContext)
 {
     if (SerializerHelper.UseFastSerialization)
     {
         using (SerializationReader reader = new SerializationReader((byte[])serializationInfo.GetValue("d", typeof(byte[]))))
         {
             _UniqueId = reader.ReadString();
             _AssociatedObjectId = reader.ReadString();
             _AssociationKind = reader.ReadString();
             _Mappings = (List<Mapping>)reader.ReadObject();
             _Name = reader.ReadString();
             _Enabled = reader.ReadBoolean();
         }
     }
     else
     {
         if (SerializationVersionExists)
         {
             try
             {
             }
             catch (SerializationException)
             {
                 // ignore
                 SerializationVersionExists = false;
             }
         }
         _AssociatedObject = (ScriptObject)serializationInfo.GetValue("AssociatedObject", ModelTypes.ScriptObject);
         _PrimaryObject = (ScriptObject)serializationInfo.GetValue("PrimaryObject", ModelTypes.ScriptObject);
         _AssociationKind = serializationInfo.GetString("AssociationKind");
         _Mappings = (List<Mapping>)serializationInfo.GetValue("Mappings", typeof(List<Mapping>));
         _Name = serializationInfo.GetString("Name");
         _Enabled = serializationInfo.GetBoolean("Enabled");
     }
 }
开发者ID:uQr,项目名称:Visual-NHibernate,代码行数:35,代码来源:Association.cs

示例6: Index

        /// <exclude/>
        public Index(SerializationInfo serializationInfo, StreamingContext streamingContext)
        {
            if (SerializerHelper.UseFastSerialization)
            {
                _columns = null;

                using (SerializationReader reader = new SerializationReader((byte[])serializationInfo.GetValue("d", typeof(byte[]))))
                {
                    UniqueId = reader.ReadString();
                    Lookups.Add(UniqueId, this);
                    _alias = reader.ReadString();
                    _columnIds = reader.ReadStringArray();
                    _enabled = reader.ReadBoolean();
                    _isUserDefined = reader.ReadBoolean();
                    _name = reader.ReadString();
                    // TODO: Parent
                    _type = reader.ReadString();
                    _userOptions = (List<IUserOption>)reader.ReadObject();
                }
            }
            else
            {
                int version = 0;

                if (SerializationVersionExists)
                {
                    try
                    {
                        version = serializationInfo.GetInt32("SerializationVersion");
                    }
                    catch (SerializationException)
                    {
                        // ignore
                        SerializationVersionExists = false;
                    }
                }
                _alias = serializationInfo.GetString("Alias");
                _columns = (List<Column>)serializationInfo.GetValue("Columns", ModelTypes.ColumnList);
                _enabled = serializationInfo.GetBoolean("Enabled");
                //this._exposedUserOptions = serializationInfo.GetValue("ExposedUserOptions", ModelTypes.Object);
                _isUserDefined = serializationInfo.GetBoolean("IsUserDefined");
                _name = serializationInfo.GetString("Name");
                _parent = (ScriptObject)serializationInfo.GetValue("Parent", ModelTypes.ScriptObject);
                _type = serializationInfo.GetString("Type");
                _userOptions = (List<IUserOption>)serializationInfo.GetValue("UserOptions", ModelTypes.UserOptionList);

                for (int i = 0; i < _userOptions.Count; i++)
                {
                    _userOptions[i].Owner = this;
                }
                if (version >= 8)
                {
                    _description = serializationInfo.GetString("Description");
                }
            }
        }
开发者ID:uQr,项目名称:Visual-NHibernate,代码行数:57,代码来源:Index.cs

示例7: UserOption

		/// <exclude/>
		public UserOption(SerializationInfo serializationInfo, StreamingContext streamingContext)
			: base()
		{
			try
			{
				using (Slyce.Common.SerializationReader reader = new SerializationReader((byte[])serializationInfo.GetValue("d", typeof(byte[]))))
				{
					_name = reader.ReadString();
					_dataType = (Type)reader.ReadObject();
					_value = reader.ReadObject();
				}
			}
			catch
			{
				this._name = serializationInfo.GetString("_name");
				this._dataType = (Type)serializationInfo.GetValue("_dataType", typeof(Type));
				this._value = serializationInfo.GetValue("_value", typeof(object));
			}
		}
开发者ID:uQr,项目名称:Visual-NHibernate,代码行数:20,代码来源:UserOption.cs

示例8: Deserialize

        public void Deserialize(byte[] Data)
        {
            SerializationReader reader = new SerializationReader(Data);
            
			AccountName = (String)reader.ReadObject();
			LatitudeID = (String)reader.ReadObject();
			Timecode = (Int64)reader.ReadObject();
			reverseGeocode = (String)reader.ReadObject();
			Latitude = (Double)reader.ReadObject();
			Longitude = (Double)reader.ReadObject();
			AccuracyInMeters = (Int32)reader.ReadObject();

        }
开发者ID:pereritob,项目名称:hacs,代码行数:13,代码来源:GoogleLatitudeDataObject.cs

示例9: Deserialize

        public void Deserialize(byte[] Data)
        {
            SerializationReader reader = new SerializationReader(Data);
            
			AccountName = (String)reader.ReadObject();
            DeviceID = (String)reader.ReadObject();
			Timestamp = (String)reader.ReadObject();
			Latitude = (String)reader.ReadObject();
			Longitude = (String)reader.ReadObject();
			AccuracyInMeters = (String)reader.ReadObject();
        }
开发者ID:pereritob,项目名称:hacs,代码行数:11,代码来源:MiataruDataObject.cs

示例10: DeserializeTriplet

 public static Triplet DeserializeTriplet(SerializationReader reader)
 {
     return new Triplet(reader.ReadObject(), reader.ReadObject(), reader.ReadObject());
 }
开发者ID:bbqchickenrobot,项目名称:FastSerializer,代码行数:4,代码来源:WebFastSerializationHelper.cs

示例11:

 void IFastSerializable.Deserialize(SerializationReader reader)
 {
     base.Deserialize(reader);
     number = (NumberOptions) reader.ReadObject();
 }
开发者ID:killix,项目名称:Virsona-ChatBot-Tools,代码行数:5,代码来源:NumberAttribute.cs

示例12: Deserialize

 private object Deserialize(ref SerializationReader mySerializationReader, DBEdge myValue)
 {
     myValue._Value = mySerializationReader.ReadObject() as IEnumerable<Exceptional<DBObjectStream>>;
     return myValue;
 }
开发者ID:ipbi,项目名称:sones,代码行数:5,代码来源:DBEdge.cs

示例13: Deserialize

        private object Deserialize(ref SerializationReader mySerializationReader, EdgeTypeSingleReference myValue)
        {
            var reference = (Reference)mySerializationReader.ReadObject();

            if (reference != null)
            {
                myValue._ObjectUUID = new Tuple<ObjectUUID, Reference>(reference.ObjectUUID, reference);
            }

            CalcEstimatedSize(myValue);

            return myValue;
        }
开发者ID:Vadi,项目名称:sones,代码行数:13,代码来源:EdgeTypeSingleReference.cs

示例14: Load

        public void Load(SerializationReader reader, Fallen8 fallen8)
        {
            if (WriteResource())
            {
                try
                {
                    reader.ReadInt32();//parameter

                    var keyCount = reader.ReadInt32();

                    _idx = new Dictionary<IComparable, List<AGraphElement>>(keyCount);

                    for (var i = 0; i < keyCount; i++)
                    {
                        var key = reader.ReadObject();
                        var value = new List<AGraphElement>();
                        var valueCount = reader.ReadInt32();
                        for (var j = 0; j < valueCount; j++)
                        {
                            var graphElementId = reader.ReadInt32();
                            AGraphElement graphElement;
                            if (fallen8.TryGetGraphElement(out graphElement, graphElementId))
                            {
                                value.Add(graphElement);
                            }
                            else
                            {
                                Logger.LogError(String.Format("[DictionaryIndex] Error while deserializing the index. Could not find the graph element \"{0}\"", graphElementId));
                            }
                        }
                        _idx.Add((IComparable)key, value);
                    }
                }
                finally
                {
                    FinishWriteResource();
                }

                return;
            }

            throw new CollisionException(this);
        }
开发者ID:politician,项目名称:fallen-8,代码行数:43,代码来源:DictionaryIndex.cs

示例15: Deserialize

        public void Deserialize(byte[] mySerializedData)
        {
            #region Data
            SerializationReader reader;

            reader = new SerializationReader(mySerializedData);

            #endregion

            #region Read Basics
            try
            {
                Name                = reader.ReadString();
                Description         = reader.ReadString();
                OwnerID             = new EntityUUID(reader.ReadByteArray());
                Type                = new TypeUUID(reader.ReadByteArray());
                Default.SetValue(reader.ReadObject());
                _Value.SetValue(reader.ReadObject());
            }
            catch (Exception e)
            {
                throw new GraphFSException_EntityCouldNotBeDeserialized("ADBSetting could not be deserialized!\n\n" + e);
            }
            #endregion
        }
开发者ID:TheByte,项目名称:sones,代码行数:25,代码来源:ADBSettingsBase.cs


注:本文中的SerializationReader.ReadObject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。