本文整理汇总了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());
}
}
示例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();
}
示例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();
}
示例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);
}
}
示例5: Serialize
public byte[] Serialize()
{
var _SerializationWriter = new SerializationWriter();
_SerializationWriter.WriteObject(CachedItemKeysToFlush);
return _SerializationWriter.ToArray();
}
示例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);
}
示例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);
}
示例8: Serialize
public static void Serialize(SerializationWriter writer, Pair pair)
{
writer.WriteObject(pair.First);
writer.WriteObject(pair.Second);
}
示例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());
}
示例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);
}
}
示例11: Serialize
private void Serialize(ref SerializationWriter mySerializationWriter, DBObjectRevisionID myValue)
{
mySerializationWriter.WriteObject((ObjectRevisionID)myValue.Value);
}
示例12: Serialize
private void Serialize(ref SerializationWriter mySerializationWriter, EdgeTypeSingleReference myValue)
{
if (myValue._ObjectUUID != null)
{
mySerializationWriter.WriteObject(myValue._ObjectUUID.Item2);
}
else
{
mySerializationWriter.WriteObject(null);
}
}
示例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);
}
}
}
示例14: Serialize
private void Serialize(ref SerializationWriter mySerializationWriter, EdgeTypeCounted myValue)
{
mySerializationWriter.WriteObject(myValue._Reference);
mySerializationWriter.WriteObject(myValue._Count);
mySerializationWriter.WriteObject(myValue._CountBy);
}
示例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
}