本文整理汇总了C#中System.Runtime.Serialization.SerializationInfo.GetChar方法的典型用法代码示例。如果您正苦于以下问题:C# SerializationInfo.GetChar方法的具体用法?C# SerializationInfo.GetChar怎么用?C# SerializationInfo.GetChar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Runtime.Serialization.SerializationInfo
的用法示例。
在下文中一共展示了SerializationInfo.GetChar方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetObjectData
public object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
{
Utility.SetFieldValue(ref obj, "_baseUrl", Utility.PrivateInstance, info.GetString("baseUrl"));
Utility.SetFieldValue(ref obj, "_token", Utility.PrivateInstance, info.GetString("token"));
Utility.SetFieldValue(ref obj, "_mapType", Utility.PrivateInstance, info.GetChar("mapType"));
return obj;
}
示例2: BootstrapContext
protected BootstrapContext(SerializationInfo info, StreamingContext context)
{
if (info == null)
return;
switch (info.GetChar(_tokenTypeKey))
{
case _securityTokenType:
{
SecurityTokenHandler sth = context.Context as SecurityTokenHandler;
if (sth != null)
{
using (XmlDictionaryReader reader = XmlDictionaryReader.CreateTextReader(Convert.FromBase64String(info.GetString(_tokenKey)), XmlDictionaryReaderQuotas.Max))
{
reader.MoveToContent();
if (sth.CanReadToken(reader))
{
string tokenName = reader.LocalName;
string tokenNamespace = reader.NamespaceURI;
SecurityToken token = sth.ReadToken(reader);
if (token == null)
{
_tokenString = Text.Encoding.UTF8.GetString(Convert.FromBase64String(info.GetString(_tokenKey)));
}
else
{
_token = token;
}
}
}
}
else
{
_tokenString = Text.Encoding.UTF8.GetString(Convert.FromBase64String(info.GetString(_tokenKey)));
}
}
break;
case _stringTokenType:
{
_tokenString = info.GetString(_tokenKey);
}
break;
case _byteTokenType:
{
_tokenBytes = (byte[])info.GetValue(_tokenKey, typeof(byte[]));
}
break;
default:
break;
}
}
示例3: TuringTapes
private TuringTapes(SerializationInfo info, StreamingContext context)
{
int n = info.GetInt32("n");
_units = new List<TuringUnit>();
for (int i = 0; i < n; i++)
_units.Add(info.GetValue("u" + i.ToString(), typeof(TuringUnit)) as TuringUnit);
_symbols = info.GetValue("s", typeof(SymbolSet)) as SymbolSet;
_defaultChar = info.GetChar("c");
_units.ForEach(x => x.Tape.Update += Tape_Update);
}
示例4: BootstrapContext
/// <summary>Initializes a new instance of the <see cref="BootstrapContext"/> class from a stream.</summary>
protected BootstrapContext (SerializationInfo info, StreamingContext context)
{
if (info == null)
throw new ArgumentNullException ("info");
char type = info.GetChar ("K");
switch (type) {
case 'S':
Token = info.GetString ("T");
break;
case 'B':
TokenBytes = (byte [])info.GetValue ("T", typeof (byte []));
break;
case 'T':
Token = Encoding.UTF8.GetString (Convert.FromBase64String (info.GetString ("T")));
break;
}
}
示例5: SftpDrive
public SftpDrive(SerializationInfo info,
StreamingContext context)
{
Name = info.GetString("name");
Host = info.GetString("host");
Port = info.GetInt32("port");
Letter = info.GetChar("drive");
Root = info.GetString("path");
Automount = info.GetBoolean("mount");
Username = info.GetString("user");
try {
ProxyType = info.GetInt32("proxyType");
ProxyHost = info.GetString("proxyHost");
ProxyUser = info.GetString("proxyUser");
ProxyPass = info.GetString("proxyPass");
}
catch { }
ConnectionType = (ConnectionType) info.GetByte("c");
if (ConnectionType == ConnectionType.Password)
{
Password = Utilities.UnprotectString(info.GetString("p"));
}
else
{
Passphrase = Utilities.UnprotectString(info.GetString("p"));
PrivateKey = info.GetString("k");
}
try
{
MountPoint = info.GetString("mountpoint");
}
catch
{
MountPoint = Name;//default is name after version update
}
}
示例6: SftpDrive
public SftpDrive(SerializationInfo info,
StreamingContext context)
{
Name = info.GetString("name");
Host = info.GetString("host");
Port = info.GetInt32("port");
Letter = info.GetChar("drive");
Root = info.GetString("path");
Automount = info.GetBoolean("mount");
Username = info.GetString("user");
ConnectionType = (ConnectionType) info.GetByte("c");
if (ConnectionType == ConnectionType.Password)
{
Password = Utilities.UnprotectString(info.GetString("p"));
}
else
{
Passphrase = Utilities.UnprotectString(info.GetString("p"));
PrivateKey = info.GetString("k");
}
}
示例7: UnexpectedFieldTypeException
/// <summary>
/// Constructor for deserialization.
/// </summary>
/// <param name="info">the info holding the serialization data</param>
/// <param name="context">the serialization context</param>
public UnexpectedFieldTypeException(SerializationInfo info, StreamingContext context) : base(info, context)
{
_fieldType = info.GetChar("FieldType");
}
示例8: clsTSMMessage
/// <summary>
/// Serialized constructor.
/// </summary>
/// <param name="info"></param>
/// <param name="context"></param>
protected clsTSMMessage(SerializationInfo info, StreamingContext context)
{
if(info != null)
{
this.Prefix = info.GetString("Prefix");
this.Number = info.GetInt32("Number");
this.Type = info.GetChar("Type");
this.Text = info.GetString("Text");
}
}
示例9: VirtualDrive
public VirtualDrive(SerializationInfo info,
StreamingContext context)
{
Letter = info.GetChar("letter");
}
示例10: Node
public Node(SerializationInfo info, StreamingContext context)
{
IP = info.GetString("i");
Port = info.GetInt32("p");
char c = info.GetChar("c");
if (c == 'c')
{
Type = NodeType.Client;
}
else {
Type = NodeType.Server;
}
}