本文整理汇总了C#中SerializationWriter.ToArray方法的典型用法代码示例。如果您正苦于以下问题:C# SerializationWriter.ToArray方法的具体用法?C# SerializationWriter.ToArray怎么用?C# SerializationWriter.ToArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SerializationWriter
的用法示例。
在下文中一共展示了SerializationWriter.ToArray方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Serialize
public byte[] Serialize()
{
var _SerializationWriter = new SerializationWriter();
_SerializationWriter.WriteString(Message);
return _SerializationWriter.ToArray();
}
示例2: Serialize
public byte[] Serialize()
{
var _SerializationWriter = new SerializationWriter();
_SerializationWriter.WriteUInt32(NumberOfQueueEntries);
return _SerializationWriter.ToArray();
}
示例3: Serialize
public byte[] Serialize()
{
var _SerializationWriter = new SerializationWriter();
_SerializationWriter.WriteString(ThrowedException);
return _SerializationWriter.ToArray();
}
示例4: 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());
}
}
示例5: Serialize
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();
}
示例6: 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();
}
示例7: Serialize
public byte[] Serialize()
{
var _SerializationWriter = new SerializationWriter();
_SerializationWriter.WriteString(ObjectLocation);
_SerializationWriter.WriteType(GraphObjectType);
return _SerializationWriter.ToArray();
}
示例8: Serialize
public byte[] Serialize()
{
var _SerializationWriter = new SerializationWriter();
_SerializationWriter.WriteString(ObjectLocation);
_SerializationWriter.WriteType(TypeOfCacheEntry);
return _SerializationWriter.ToArray();
}
示例9: 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.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
}
示例10: GetObjectData
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
}
示例11: Serialize
public Byte[] Serialize()
{
var _SerializationWriter = new SerializationWriter();
_SerializationWriter.WriteString(ObjectLocation.ToString());
_SerializationWriter.WriteString(ObjectStream);
_SerializationWriter.WriteString(ObjectEdition);
_SerializationWriter.WriteString(ObjectRevisionID.ToString());
return _SerializationWriter.ToArray();
}
示例12: 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(_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
}
示例13: GetObjectData
/// <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());
}
示例14: 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
}
示例15: 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());
}