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


C# SerializationWriter.WriteObject方法代码示例

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


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

示例1: GetObjectData

		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());
			}

		}
开发者ID:uQr,项目名称:Visual-NHibernate,代码行数:11,代码来源:UserOption.cs

示例2: Serialize

        public byte[] Serialize()
        {
            SerializationWriter writer = new SerializationWriter();

            writer.WriteObject(AccountName);
			writer.WriteObject(LatitudeID);
            writer.WriteObject(Timecode);
			writer.WriteObject(reverseGeocode);
			writer.WriteObject(Latitude);
			writer.WriteObject(Longitude);
			writer.WriteObject(AccuracyInMeters);

            return writer.ToArray();
        }
开发者ID:pereritob,项目名称:hacs,代码行数:14,代码来源:GoogleLatitudeDataObject.cs

示例3: Serialize

        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();
        }
开发者ID:pereritob,项目名称:hacs,代码行数:22,代码来源:XS1_DataObject.cs

示例4: Serialize

        public void Serialize(ref SerializationWriter mySerializationWriter)
        {
            //type code for the set collection wrapper
            mySerializationWriter.WriteInt16(1);
            
            mySerializationWriter.WriteInt32(Value.Count);

            foreach (var item in Value)
            {
                mySerializationWriter.WriteObject(item);
            }
        }
开发者ID:anukat2015,项目名称:sones,代码行数:12,代码来源:SetCollectionWrapper.cs

示例5: Serialize

            public byte[] Serialize()
            {
                var _SerializationWriter = new SerializationWriter();
                _SerializationWriter.WriteObject(CachedItemKeysToFlush);

                return _SerializationWriter.ToArray();
            }
开发者ID:TheByte,项目名称:sones,代码行数:7,代码来源:NObjectCache_FlushCacheItems.cs

示例6: Save

        public void Save(SerializationWriter writer)
        {
            if (ReadResource())
            {
                try
                {
                    writer.Write(0);//parameter
                    writer.Write(_idx.Count);
                    foreach (var aKV in _idx)
                    {
                        writer.WriteObject(aKV.Key);
                        writer.Write(aKV.Value.Count);
                        foreach (var aItem in aKV.Value)
                        {
                            writer.Write(aItem.Id);
                        }
                    }
                }
                finally
                {
                    FinishReadResource();
                }

                return;
            }

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

示例7: Serialize

        public void Serialize(SerializationWriter mySerializationWriter, object value)
        {
            LicensedFeatures thisObject = (LicensedFeatures)value;

            mySerializationWriter.WriteObject((UInt32)thisObject.Features.Count);

            foreach (var entry in thisObject.Features)
                mySerializationWriter.WriteByte((Byte)entry);

            mySerializationWriter.WriteInt32(thisObject.NumberOfLicensedCPUs);
            mySerializationWriter.WriteInt32(thisObject.NumberOfLicensedRAM);
        }
开发者ID:TheByte,项目名称:sones,代码行数:12,代码来源:LicensedFeatures.cs

示例8: Serialize

 public static void Serialize(SerializationWriter writer, Pair pair)
 {
     writer.WriteObject(pair.First);
     writer.WriteObject(pair.Second);
 }
开发者ID:bbqchickenrobot,项目名称:FastSerializer,代码行数:5,代码来源:WebFastSerializationHelper.cs

示例9: GetObjectData

        /// <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());
        }
开发者ID:paralin,项目名称:SuperPool,代码行数:15,代码来源:EnvelopeStamp.cs

示例10: Serialize

 private void Serialize(ref SerializationWriter mySerializationWriter, IndexKey myValue)
 {
     mySerializationWriter.WriteUInt32((UInt32)myValue.IndexKeyValues.Count);
     foreach (var attr in myValue.IndexKeyValues)
     {
         //attr.Serialize(ref mySerializationWriter);
         mySerializationWriter.WriteObject(attr);
     }
 }
开发者ID:ipbi,项目名称:sones,代码行数:9,代码来源:IndexKey.cs

示例11: Serialize

 private void Serialize(ref SerializationWriter mySerializationWriter, DBObjectRevisionID myValue)
 {
     mySerializationWriter.WriteObject((ObjectRevisionID)myValue.Value);
 }
开发者ID:ipbi,项目名称:sones,代码行数:4,代码来源:DBObjectRevisionID.cs

示例12: Serialize

        private void Serialize(ref SerializationWriter mySerializationWriter, EdgeTypeSingleReference myValue)
        {
            if (myValue._ObjectUUID != null)
            {
                mySerializationWriter.WriteObject(myValue._ObjectUUID.Item2);
            }
            else
            {
                mySerializationWriter.WriteObject(null);

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

示例13: Serialize

        public override void Serialize(ref SerializationWriter mySerializationWriter)
        {
            if (mySerializationWriter != null)
            {

                try
                {

                    ParentTypeUUID.Serialize(ref mySerializationWriter);
                    mySerializationWriter.WriteBoolean(_IsUserDefined);
                    mySerializationWriter.WriteBoolean(_IsAbstract);
                    mySerializationWriter.WriteString(_Comment);

                    mySerializationWriter.WriteUInt32((UInt32)_Attributes.Count);

                    foreach (var pValPair in _Attributes)
                    {
                        pValPair.Key.Serialize(ref mySerializationWriter);
                        pValPair.Value.Serialize(ref mySerializationWriter);
                    }

                    mySerializationWriter.WriteUInt32((UInt32)_TypeSettings.Count);

                    foreach (var pValPair in _TypeSettings)
                        mySerializationWriter.WriteObject(pValPair.Value);

                    mySerializationWriter.WriteUInt32((UInt32)_UniqueAttributes.Count);

                    foreach (var pValPair in _UniqueAttributes)
                        pValPair.Serialize(ref mySerializationWriter);

                    mySerializationWriter.WriteUInt32((UInt32)_MandatoryAttributes.Count);

                    foreach (var pValPair in _MandatoryAttributes)
                        pValPair.Serialize(ref mySerializationWriter);

                    mySerializationWriter.WriteUInt16((UInt16)ObjectDirectoryShards);

                    #region Indices

                    mySerializationWriter.WriteUInt32((UInt32)_AttributeIndices.Count);

                    foreach (var idx in _AttributeIndices)
                    {
                        idx.Key.Serialize(ref mySerializationWriter);

                        mySerializationWriter.WriteUInt32((UInt32)idx.Value.Count);
                        foreach (var idxType in idx.Value)
                        {
                            mySerializationWriter.WriteString(idxType.Key);
                            mySerializationWriter.WriteString(idxType.Value.FileSystemLocation.ToString());
                            mySerializationWriter.WriteString(idxType.Value.IndexEdition);
                            mySerializationWriter.WriteString(idxType.Value.IndexName);
                            mySerializationWriter.WriteString(idxType.Value.IndexType);
                            mySerializationWriter.WriteBoolean(idxType.Value is UUIDIndex);
                            mySerializationWriter.WriteUInt64(idxType.Value.GetKeyCount());
                            mySerializationWriter.WriteUInt64(idxType.Value.GetValueCount());
                            mySerializationWriter.WriteUInt16(idxType.Value.AttributeIdxShards);
                        }
                    }

                    #endregion

                }

                catch (Exception e)
                {
                    throw new SerializationException("The GraphDBType could not be serialized!\n\n" + e);
                }

            }
        }
开发者ID:TheByte,项目名称:sones,代码行数:72,代码来源:GraphDBType.cs

示例14: Serialize

 private void Serialize(ref SerializationWriter mySerializationWriter, EdgeTypeCounted myValue)
 {
     mySerializationWriter.WriteObject(myValue._Reference);
     mySerializationWriter.WriteObject(myValue._Count);
     mySerializationWriter.WriteObject(myValue._CountBy);
 }
开发者ID:Vadi,项目名称:sones,代码行数:6,代码来源:EdgeTypeCounted.cs

示例15: GetObjectData

 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
 }
开发者ID:uQr,项目名称:Visual-NHibernate,代码行数:52,代码来源:Column.cs


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