本文整理汇总了C#中SerializationInfo.GetString方法的典型用法代码示例。如果您正苦于以下问题:C# SerializationInfo.GetString方法的具体用法?C# SerializationInfo.GetString怎么用?C# SerializationInfo.GetString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SerializationInfo
的用法示例。
在下文中一共展示了SerializationInfo.GetString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PSArgumentException
/// <summary>
/// Initializes a new instance of the PSArgumentException class
/// using data serialized via
/// <see cref="System.Runtime.Serialization.ISerializable"/>
/// </summary>
/// <param name="info"> serialization information </param>
/// <param name="context"> streaming context </param>
/// <returns> constructed object </returns>
protected PSArgumentException(SerializationInfo info,
StreamingContext context)
: base(info, context)
{
_errorId = info.GetString("ErrorId");
_message = info.GetString("PSArgumentException_MessageOverride");
}
示例2: YahooStockDataSource
/// <summary>
/// Restore state.
/// </summary>
public YahooStockDataSource(SerializationInfo info, StreamingContext context)
: base(info, context)
{
_filesFolder = info.GetString("filesFolder");
_yahooStockSymbolsFileName = info.GetString("yahooStockSymbolsFileName");
_dataSourceStub = (DataSourceStub)info.GetValue("dataSourceStub", typeof(DataSourceStub));
_dataSourceStub.Initialize(this);
}
示例3: AuthenticationInfo
public AuthenticationInfo(SerializationInfo info, StreamingContext context)
{
IsAuthenticated = info.GetBoolean("IsAuthenticated");
UserId = info.GetString("UserId");
UserAlias = info.GetString("UserAlias");
UserName = info.GetString("UserName");
Token = info.GetString("Token");
TokenSecret = info.GetString("TokenSecret");
}
示例4: BaseApplicationException
/// <summary>
/// Constructor used for deserialization of the exception class.
/// </summary>
/// <param name="info">Represents the SerializationInfo of the exception.</param>
/// <param name="context">Represents the context information of the exception.</param>
protected BaseApplicationException(SerializationInfo info, StreamingContext context) : base(info, context)
{
machineName = info.GetString("machineName");
createdDateTime = info.GetDateTime("createdDateTime");
appDomainName = info.GetString("appDomainName");
threadIdentity = info.GetString("threadIdentity");
windowsIdentity = info.GetString("windowsIdentity");
additionalInformation = (NameValueCollection)info.GetValue("additionalInformation",typeof(NameValueCollection));
}
示例5: Xunit1TestCase
/// <inheritdoc/>
protected Xunit1TestCase(SerializationInfo info, StreamingContext context)
{
reflectionWrapper = new Xunit1ReflectionWrapper(
info.GetString("AssemblyFileName"),
info.GetString("TypeName"),
info.GetString("MethodName")
);
DisplayName = info.GetString("DisplayName");
SkipReason = info.GetString("SkipReason");
SourceInformation = info.GetValue<SourceInformation>("SourceInformation");
Traits = info.GetValue<IDictionary<string, string>>("Traits");
}
示例6: Drawing
// Constructor for deserialization - should be used by serializer
public Drawing(SerializationInfo info, StreamingContext ctxt)
{
name = info.GetString("Name");
author = info.GetString("Author");
timestamp = (DateTime)info.GetValue("Timestamp", typeof(DateTime));
item = info.GetString("Item");
byte[] bgBytes = (byte[])info.GetValue("Background", typeof(byte[]));
backgroundA = bgBytes[0];
backgroundR = bgBytes[1];
backgroundG = bgBytes[2];
backgroundB = bgBytes[3];
strokes = (List<SampledStroke>)info.GetValue("Strokes", typeof(List<SampledStroke>));
readOnly = true;
}
示例7: RuntimeException
/// <summary>
/// Initializes a new instance of the RuntimeException class
/// using data serialized via
/// <see cref="ISerializable"/>
/// </summary>
/// <param name="info"> serialization information </param>
/// <param name="context"> streaming context </param>
/// <returns> constructed object </returns>
protected RuntimeException(SerializationInfo info,
StreamingContext context)
: base(info, context)
{
_errorId = info.GetString("ErrorId");
_errorCategory = (ErrorCategory)info.GetInt32("ErrorCategory");
}
示例8: Xunit1TestCase
/// <inheritdoc/>
protected Xunit1TestCase(SerializationInfo info, StreamingContext context)
{
reflectionWrapper = new Xunit1ReflectionWrapper(
info.GetString("AssemblyFileName"),
info.GetString("TypeName"),
info.GetString("MethodName")
);
DisplayName = info.GetString("DisplayName");
SkipReason = info.GetString("SkipReason");
SourceInformation = info.GetValue<SourceInformation>("SourceInformation");
Traits = new Dictionary<string, List<string>>(StringComparer.OrdinalIgnoreCase);
var keys = info.GetValue<List<string>>("Traits.Keys");
foreach (var key in keys)
Traits.Add(key, info.GetValue<List<string>>(String.Format("Traits[{0}]", key)));
}
示例9: ConfigurationException
protected ConfigurationException(SerializationInfo info,
StreamingContext context)
: base(info, context)
{
HResult = unchecked((int)0x80131902);
this.filename = info.GetString("filename");
this.line = info.GetInt32("line");
}
示例10: Uri
protected Uri(SerializationInfo serializationInfo, StreamingContext streamingContext)
{
string uri = serializationInfo.GetString("AbsoluteUri");
if (uri.Length != 0)
{
this.CreateThis(uri, false, UriKind.Absolute);
}
else
{
uri = serializationInfo.GetString("RelativeUri");
if (uri == null)
{
throw new ArgumentNullException("uriString");
}
this.CreateThis(uri, false, UriKind.Relative);
}
}
示例11: ConfigurationErrorsException
protected ConfigurationErrorsException(SerializationInfo info, StreamingContext context) : base(info, context)
{
string filename = info.GetString("firstFilename");
int line = info.GetInt32("firstLine");
this.Init(filename, line);
int num2 = info.GetInt32("count");
if (num2 != 0)
{
this._errors = new ConfigurationException[num2];
for (int i = 0; i < num2; i++)
{
string str2 = i.ToString(CultureInfo.InvariantCulture);
Type type = Type.GetType(info.GetString(str2 + "_errors_type"), true);
if ((type != typeof(ConfigurationException)) && (type != typeof(ConfigurationErrorsException)))
{
throw ExceptionUtil.UnexpectedError("ConfigurationErrorsException");
}
this._errors[i] = (ConfigurationException) info.GetValue(str2 + "_errors", type);
}
}
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:21,代码来源:ConfigurationErrorsException.cs
示例12: 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));
}
}
示例13: TestDiagnostic
private TestDiagnostic(SerializationInfo info, StreamingContext context)
{
var id = info.GetString("id");
_kind = info.GetString("kind");
_message = info.GetString("message");
_location = (Location)info.GetValue("location", typeof(Location));
_severity = (DiagnosticSeverity)info.GetValue("severity", typeof(DiagnosticSeverity));
var defaultSeverity = (DiagnosticSeverity)info.GetValue("defaultSeverity", typeof(DiagnosticSeverity));
_arguments = (object[])info.GetValue("arguments", typeof(object[]));
_descriptor = new DiagnosticDescriptor(id, string.Empty, _message, id, defaultSeverity, isEnabledByDefault: true);
}
示例14: GlobalDefine
protected GlobalDefine( SerializationInfo info, StreamingContext context )
{
define = info.GetString( "define" );
enabled = info.GetBoolean( "enabled" );
}
示例15: RestartComputerTimeoutException
/// <summary>
/// Serialization constructor for class RestartComputerTimeoutException
/// </summary>
///
/// <param name="info">
/// serialization information
/// </param>
///
/// <param name="context">
/// streaming context
/// </param>
private RestartComputerTimeoutException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
if (info == null)
{
throw new PSArgumentNullException("info");
}
ComputerName = info.GetString("ComputerName");
Timeout = info.GetInt32("Timeout");
}