本文整理汇总了C#中System.Runtime.Serialization.SerializationInfo.GetString方法的典型用法代码示例。如果您正苦于以下问题:C# SerializationInfo.GetString方法的具体用法?C# SerializationInfo.GetString怎么用?C# SerializationInfo.GetString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Runtime.Serialization.SerializationInfo
的用法示例。
在下文中一共展示了SerializationInfo.GetString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Lookup
/// <exclude/>
public Lookup(SerializationInfo serializationInfo, StreamingContext streamingContext)
{
int version = 0;
if (SerializationVersionExists)
{
try
{
version = serializationInfo.GetInt32("SerializationVersion");
}
catch (SerializationException)
{
// ignore
SerializationVersionExists = false;
}
}
_alias = serializationInfo.GetString("Alias");
_aliasPlural = serializationInfo.GetString("AliasPlural");
_enabled = serializationInfo.GetBoolean("Enabled");
_isUserDefined = serializationInfo.GetBoolean("IsUserDefined");
_name = serializationInfo.GetString("Name");
_userOptions = (List<IUserOption>)serializationInfo.GetValue("UserOptions", ModelTypes.UserOptionList);
_description = serializationInfo.GetString("Description");
_backingObject = (ScriptObject)serializationInfo.GetValue("BackingObject", ModelTypes.ScriptObject);
_idColumn = (Column)serializationInfo.GetValue("IdColumn", ModelTypes.Column);
_nameColumn = (Column)serializationInfo.GetValue("NameColumn", ModelTypes.Column);
_LookupValues = (List<LookupValue>)serializationInfo.GetValue("LookupValues", ModelTypes.LookupValueList);
}
示例2: ProxyObjectReference
protected ProxyObjectReference(SerializationInfo info, StreamingContext context)
{
// Deserialize the base type using its assembly qualified name
string qualifiedName = info.GetString("__baseType");
_baseType = System.Type.GetType(qualifiedName, true, false);
// Rebuild the list of interfaces
var interfaceList = new List<System.Type>();
int interfaceCount = info.GetInt32("__baseInterfaceCount");
for (int i = 0; i < interfaceCount; i++)
{
string keyName = string.Format("__baseInterface{0}", i);
string currentQualifiedName = info.GetString(keyName);
System.Type interfaceType = System.Type.GetType(currentQualifiedName, true, false);
interfaceList.Add(interfaceType);
}
// Reconstruct the proxy
var factory = new ProxyFactory();
System.Type proxyType = factory.CreateProxyType(_baseType, interfaceList.ToArray());
// Initialize the proxy with the deserialized data
var args = new object[] {info, context};
_proxy = (IProxy) Activator.CreateInstance(proxyType, args);
}
示例3: MemberInfoSerializationHolder
// Constructor.
public MemberInfoSerializationHolder(SerializationInfo info,
StreamingContext context)
{
if(info == null)
{
throw new ArgumentNullException("info");
}
memberType = (MemberTypes)(info.GetInt32("MemberType"));
name = info.GetString("Name");
signature = info.GetString("Signature");
String assemblyName = info.GetString("AssemblyName");
String className = info.GetString("ClassName");
if(assemblyName == null || className == null)
{
throw new SerializationException
(_("Serialize_StateMissing"));
}
Assembly assembly = FormatterServices.GetAssemblyByName
(assemblyName);
if(assembly == null)
{
throw new SerializationException
(_("Serialize_StateMissing"));
}
containingType = FormatterServices.GetTypeFromAssembly
(assembly, className);
}
示例4: VideoFile
private VideoFile(SerializationInfo info, DeserializeInfo di)
: this(di.Server, di.Info, di.Type)
{
actors = info.GetValue("a", typeof(string[])) as string[];
description = info.GetString("de");
director = info.GetString("di");
genre = info.GetString("g");
title = info.GetString("t");
try {
width = info.GetInt32("w");
height = info.GetInt32("h");
}
catch (Exception) {
}
var ts = info.GetInt64("du");
if (ts > 0) {
duration = new TimeSpan(ts);
}
try {
bookmark = info.GetInt64("b");
}
catch (Exception) {
bookmark = 0;
}
try {
subTitle = info.GetValue("st", typeof(Subtitle)) as Subtitle;
}
catch (Exception) {
subTitle = null;
}
initialized = true;
}
示例5: InRangeException
/// <inheritdoc/>
protected InRangeException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
actual = info.GetString("Actual");
high = info.GetString("High");
low = info.GetString("Low");
}
示例6: MandrillException
protected MandrillException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
Status = info.GetString("Status");
Code = (int?) info.GetValue("Code", typeof (int?));
Name = info.GetString("Name");
}
示例7: ProxyObjectReference
/// <summary>
/// Initializes a new instance of the ProxyObjectReference class.
/// </summary>
/// <param name="info">The <see cref="SerializationInfo"/> class that contains the serialized data.</param>
/// <param name="context">The <see cref="StreamingContext"/> that describes the serialization state.</param>
protected ProxyObjectReference(SerializationInfo info, StreamingContext context)
{
// Deserialize the base type using its assembly qualified name
string qualifiedName = info.GetString("__baseType");
_baseType = Type.GetType(qualifiedName, true, false);
// Rebuild the list of interfaces
List<Type> interfaceList = new List<Type>();
int interfaceCount = info.GetInt32("__baseInterfaceCount");
for (int i = 0; i < interfaceCount; i++)
{
string keyName = string.Format("__baseInterface{0}", i);
string currentQualifiedName = info.GetString(keyName);
Type interfaceType = Type.GetType(currentQualifiedName, true, false);
interfaceList.Add(interfaceType);
}
// Reconstruct the proxy
ProxyFactory factory = new ProxyFactory();
Type proxyType = factory.CreateProxyType(_baseType, interfaceList.ToArray());
_proxy = (IProxy)Activator.CreateInstance(proxyType);
IInterceptor interceptor = (IInterceptor)info.GetValue("__interceptor", typeof(IInterceptor));
_proxy.Interceptor = interceptor;
}
示例8: MissingMemberException
protected MissingMemberException (SerializationInfo info, StreamingContext context)
: base (info, context)
{
ClassName = info.GetString ("MMClassName");
MemberName = info.GetString ("MMMemberName");
Signature = (byte[]) info.GetValue ("MMSignature", typeof(byte[]));
}
示例9: RevokeRoleStatement
public RevokeRoleStatement(SerializationInfo info, StreamingContext context)
: base(info, context)
{
Grantee = info.GetString("Grantee");
RoleName = info.GetString("Role");
Admin = info.GetBoolean("Admin");
}
示例10: SetObjectData
public object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
{
typeof(Point).GetField("X").SetValue(obj, info.GetString("X"));
typeof(Point).GetField("Y").SetValue(obj, info.GetString("Y"));
return null;
}
示例11: ErrorDetails
protected ErrorDetails(SerializationInfo info, StreamingContext context)
{
this._message = "";
this._recommendedAction = "";
this._message = info.GetString("ErrorDetails_Message");
this._recommendedAction = info.GetString("ErrorDetails_RecommendedAction");
}
示例12: InternalLoggerException
// FIXME: I made it private temporarily, later we can change it to internal (but not protected)
private InternalLoggerException (SerializationInfo info, StreamingContext context)
: base (info, context)
{
buildEventArgs = (BuildEventArgs) info.GetValue ("BuildEventArgs", typeof (BuildEventArgs));
errorCode = info.GetString ("ErrorCode");
helpKeyword = info.GetString ("HelpKeywordPrefix");
}
示例13: QueueCacheMissException
public QueueCacheMissException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
Requested = info.GetString("Requested");
Low = info.GetString("Low");
High = info.GetString("High");
}
示例14: SerializationWrapper
protected SerializationWrapper(SerializationInfo info, StreamingContext context)
{
var typeName = info.GetString("Type");
_type = Type.GetType(typeName);
var xml = info.GetString("Item");
_item = SerializeHelper.Deserialize(_type, xml);
}
示例15: StringData
protected StringData(SerializationInfo si, StreamingContext ctx)
{
//从流中得到合并的成员变量
dataItemOne = si.GetString("First_Item").ToLower();
dataItemTwo = si.GetString("Second_Item").ToLower();
}