本文整理汇总了C#中DeserializeContext.ReadString方法的典型用法代码示例。如果您正苦于以下问题:C# DeserializeContext.ReadString方法的具体用法?C# DeserializeContext.ReadString怎么用?C# DeserializeContext.ReadString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DeserializeContext
的用法示例。
在下文中一共展示了DeserializeContext.ReadString方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Deserialize
/// <summary>
/// Deserializes binary data to object.
/// </summary>
/// <param name="context">Context for deserialization</param>
protected override void Deserialize(DeserializeContext context, byte version)
{
base.Deserialize(context, version);
SystemName = context.ReadMultiLanguageString();
WelcomeMessage = context.ReadMultiLanguageString();
Image = context.ReadBytes();
Url = context.ReadString();
UpdateVersion = context.ReadString();
UpdateUrl = context.ReadString();
}
示例2: Deserialize
/// <summary>
/// Deserializes binary data to object.
/// </summary>
/// <param name="context">Context for deserialization</param>
protected override void Deserialize(DeserializeContext context, byte version)
{
base.Deserialize(context, version);
this.fullName = context.ReadString();
}
示例3: RunExtract
private void RunExtract()
{
try
{
Progress = 0;
FileStream fileStream = new FileStream(this.backupFile, FileMode.Open, FileAccess.Read);
GZipStream gzipStream = new GZipStream(fileStream, CompressionMode.Decompress);
DeserializeContext context = new DeserializeContext(gzipStream);
int fileCount = context.ReadInt32();
long totalSize = context.ReadInt64();
long doneSize = 0;
for (int index = 0; index < fileCount; index++)
{
string fileName = context.ReadString();
FileName = fileName;
byte[] data = context.ReadBytes();
File.WriteAllBytes(Path.Combine(this.dataPath, fileName), data);
doneSize += data.Length;
Progress = 1d / (double)totalSize * (double)doneSize;
}
context.Close();
gzipStream.Close();
fileStream.Close();
}
catch (Exception exception)
{
Exception = exception;
}
Complete = true;
}
示例4: Deserialize
/// <summary>
/// Deserializes binary data to object.
/// </summary>
/// <param name="context">Context for deserialization</param>
protected override void Deserialize(DeserializeContext context, byte version)
{
base.Deserialize(context, version);
FirstName = context.ReadString();
FamilyName = context.ReadString();
EmailAddress = context.ReadString();
}
示例5: Deserialize
/// <summary>
/// Deserialize a string.
/// </summary>
/// <param name="context">Context of the deserialization.</param>
/// <returns>Deserialized multi language string.</returns>
public static MultiLanguageString Deserialize(DeserializeContext context)
{
int count = context.ReadInt32();
MultiLanguageString value = new MultiLanguageString();
for (int index = 0; index < count; index++)
{
value.content.Add((Language)context.ReadInt32(), context.ReadString());
}
return value;
}
示例6: Deserialize
/// <summary>
/// Deserializes binary data to object.
/// </summary>
/// <param name="context">Context for deserialization</param>
protected override void Deserialize(DeserializeContext context, byte version)
{
base.Deserialize(context, version);
SubjectId = context.ReadGuid();
Status = (SignatureResponseStatus)context.ReadInt32();
Reason = context.ReadString();
Signature = context.ReadObject<Signature>();
}
示例7: FromBinary
/// <summary>
/// Deserializes an exception from binary data.
/// </summary>
/// <param name="data">Binary data of exception.</param>
/// <returns>An exception.</returns>
public static PiException FromBinary(byte[] data)
{
MemoryStream stream = new MemoryStream(data);
DeserializeContext context = new DeserializeContext(stream);
string typeName = context.ReadString();
ExceptionCode code = (ExceptionCode)context.ReadInt32();
string message = context.ReadString();
Type type = Type.GetType(typeName);
PiException exception = (PiException)Activator.CreateInstance(type, new object[] { code, code.Text() });
exception.ServerMessage = message;
context.Close();
stream.Close();
return exception;
}
示例8: Deserialize
/// <summary>
/// Deserializes binary data to object.
/// </summary>
/// <param name="context">Context for deserialization</param>
protected override void Deserialize(DeserializeContext context, byte version)
{
base.Deserialize(context, version);
Message = context.ReadString();
}
示例9: Deserialize
/// <summary>
/// Deserializes binary data to object.
/// </summary>
/// <param name="context">Context for deserialization</param>
protected override void Deserialize(DeserializeContext context, byte version)
{
base.Deserialize(context, version);
EmailAddress = context.ReadString();
if (version >= 1)
{
EncryptedSignatureRequest = context.ReadBytes();
}
else
{
EncryptedSignatureRequest = new byte[0];
}
}