本文整理汇总了C#中SerializationReader.ReadString方法的典型用法代码示例。如果您正苦于以下问题:C# SerializationReader.ReadString方法的具体用法?C# SerializationReader.ReadString怎么用?C# SerializationReader.ReadString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SerializationReader
的用法示例。
在下文中一共展示了SerializationReader.ReadString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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");
}
}
示例2: 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");
}
}
}
示例3: Deserialize
public void Deserialize(byte[] mySerializedBytes)
{
SerializationReader reader = new SerializationReader(mySerializedBytes);
ServiceGlobalUniqueName = reader.ReadString();
String _ServiceUri = reader.ReadString();
ServiceType = (DiscoverableServiceType)reader.ReadOptimizedByte();
if (!Uri.TryCreate(_ServiceUri,UriKind.Absolute,out ServiceUri))
throw new NotificationException_InvalidNotificationPayload("IP not parseable. Notification Packet invalid!");
}
示例4: DeserializeOrder
public static MarketOrder DeserializeOrder(SerializationReader reader)
{
var deal = new MarketOrder
{
ID = reader.ReadInt32(),
AccountID = reader.ReadInt32(),
Comment = reader.ReadString(),
ExitReason = (PositionExitReason)reader.ReadInt16(),
ExpertComment = reader.ReadString(),
PriceEnter = reader.ReadSingle(),
ResultDepo = reader.ReadSingle(),
ResultPoints = reader.ReadSingle(),
Side = reader.ReadSByte(),
State = (PositionState) reader.ReadInt16(),
Symbol = reader.ReadString(),
TimeEnter = reader.ReadDateTime(),
Trailing = reader.ReadString(),
Volume = reader.ReadInt32(),
VolumeInDepoCurrency = reader.ReadSingle()
};
// nullable values
var flags = reader.ReadOptimizedBitVector32();
if (flags[magicIsValued])
deal.Magic = reader.ReadInt32();
if (flags[pendingOrderIdIsValued])
deal.PendingOrderID = reader.ReadInt32();
if (flags[priceBestIsValued])
deal.PriceBest = reader.ReadSingle();
if (flags[priceExitIsValued])
deal.PriceExit = reader.ReadSingle();
if (flags[priceWorstIsValued])
deal.PriceWorst = reader.ReadSingle();
if (flags[stopLossIsValued])
deal.StopLoss = reader.ReadSingle();
if (flags[swapIsValued])
deal.Swap = reader.ReadSingle();
if (flags[takeProfitIsValued])
deal.TakeProfit = reader.ReadSingle();
if (flags[timeExitIsValued])
deal.TimeExit = reader.ReadDateTime();
return deal;
}
示例5: Deserialize
public void Deserialize(byte[] mySerializedBytes)
{
var _SerializationReader = new SerializationReader(mySerializedBytes);
StorageURIs = new List<String>();
UInt32 numberOfStorageURIs = _SerializationReader.ReadUInt32();
for (Int32 i = 0; i < numberOfStorageURIs; i++)
StorageURIs.Add(_SerializationReader.ReadString());
StorageType = _SerializationReader.ReadString();
StorageSize = _SerializationReader.ReadUInt64();
}
示例6: Deserialize
public void Deserialize(byte[] mySerializedBytes)
{
var _SerializationReader = new SerializationReader(mySerializedBytes);
ObjectLocation = _SerializationReader.ReadString();
NewDefaultRule = _SerializationReader.ReadOptimizedByte();
}
示例7: Deserialize
public void Deserialize(byte[] mySerializedBytes)
{
var reader = new SerializationReader(mySerializedBytes);
ObjectLocation = reader.ReadString();
RightUUID = new UUID(reader.ReadByteArray());
EntitiyUUID = new UUID(reader.ReadByteArray());
}
示例8: SuperPoolCall
/// <summary>
/// Implementing the ISerializable to provide a faster, more optimized
/// serialization for the class.
/// </summary>
/// <param name="info"></param>
/// <param name="context"></param>
public SuperPoolCall(SerializationInfo info, StreamingContext context)
{
// Get from the info.
SerializationReader reader = new SerializationReader((byte[])info.GetValue("data", typeof(byte[])));
Id = reader.ReadInt64();
State = (StateEnum)reader.ReadInt32();
RequestResponse = reader.ReadBoolean();
Parameters = reader.ReadObjectArray();
string methodInfoName = reader.ReadString();
_methodInfoName = methodInfoName;
MethodInfoLocal = SerializationHelper.DeserializeMethodBaseFromString(_methodInfoName, true);
}
示例9: 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));
}
}
示例10: Deserialize
private object Deserialize(ref SerializationReader mySerializationReader, DirectoryEntry myDirectoryEntry)
{
try
{
#region Read the Inlinedata
myDirectoryEntry._InlineData = mySerializationReader.ReadByteArray();
#region Estimated Size
if (myDirectoryEntry._InlineData != null)
{
myDirectoryEntry._estimatedSize += Convert.ToUInt64(myDirectoryEntry._InlineData.Length) * EstimatedSizeConstants.Byte;
}
#endregion
#endregion
#region Read the INodePositions
#region Estimated Size
myDirectoryEntry._estimatedSize += EstimatedSizeConstants.HashSet;
#endregion
var _NumOfINodePositions = mySerializationReader.ReadUInt32();
if (_NumOfINodePositions > 0)
{
for (var j = 0UL; j < _NumOfINodePositions; j++)
{
StorageUUID ID = new StorageUUID();
ID.Deserialize(ref mySerializationReader);
myDirectoryEntry._INodePositions.Add(new ExtendedPosition(ID, mySerializationReader.ReadUInt64()));
#region Estimated Size
myDirectoryEntry._estimatedSize += EstimatedSizeConstants.ExtendedPosition;
#endregion
}
}
#endregion
#region Read the ObjectStreamsList
#region Estimated Size
myDirectoryEntry._estimatedSize += EstimatedSizeConstants.HashSet;
#endregion
var _NumberOfObjectStreamTypes = mySerializationReader.ReadUInt32();
if (_NumberOfObjectStreamTypes > 0)
{
for (var j = 0UL; j < _NumberOfObjectStreamTypes; j++)
{
myDirectoryEntry._ObjectStreamsList.Add(mySerializationReader.ReadString());
#region Estimated Size
myDirectoryEntry._estimatedSize += EstimatedSizeConstants.Char * EstimatedSizeConstants.EstimatedObjectStreamNameLength;
#endregion
}
}
#endregion
}
catch (GraphFSException e)
{
throw new GraphFSException("DirectoryEntry could not be deserialized!\n\n" + e);
}
myDirectoryEntry.isDirty = true;
return myDirectoryEntry;
}
示例11: Load
public void Load(SerializationReader reader, Fallen8 fallen8)
{
if (WriteResource())
{
reader.ReadInt32();//parameter
var keyCount = reader.ReadInt32();
_idx = new Dictionary<String, List<AGraphElement>>(keyCount);
for (var i = 0; i < keyCount; i++)
{
var key = reader.ReadString();
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("Error while deserializing the index. Could not find the graph element \"{0}\"", graphElementId));
}
}
_idx.Add(key, value);
}
FinishWriteResource();
return;
}
throw new CollisionException(this);
}
示例12: SetObjectData
protected override void SetObjectData(SerializationReader sr)
{
base.SetObjectData(sr);
sr.ReadInt32();
_Url = sr.ReadString();
}
示例13: Deserialize
public void Deserialize(SerializationReader reader)
{
definition = reader.ReadString();
phrases = reader.ReadList<InformedPhrase>();
attributes = reader.ReadList<PhraseAttribute>();
}
示例14: SetObjectData
protected override void SetObjectData(SerializationReader sr)
{
base.SetObjectData(sr);
f_ImageFileName = sr.ReadString();
f_AlternativeText = sr.ReadString();
}
示例15: Deserialize
public void Deserialize(Byte[] mySerializedBytes)
{
var _SerializationReader = new SerializationReader(mySerializedBytes);
ObjectLocation = new ObjectLocation(_SerializationReader.ReadString());
ObjectStream = _SerializationReader.ReadString();
ObjectEdition = _SerializationReader.ReadString();
ObjectRevisionID = new ObjectRevisionID(_SerializationReader.ReadString());
}