当前位置: 首页>>代码示例>>C#>>正文


C# SerializationInfo.GetChar方法代码示例

本文整理汇总了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;
 }
开发者ID:galchen,项目名称:brutile,代码行数:7,代码来源:BingRequestSurrogate.cs

示例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;
            }
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:56,代码来源:BootstrapContext.cs

示例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);
        }
开发者ID:Hrombel,项目名称:AbstractDevelop,代码行数:13,代码来源:TuringTapes.cs

示例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;
			}
		}
开发者ID:Profit0004,项目名称:mono,代码行数:18,代码来源:BootstrapContext.cs

示例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
     }
 }
开发者ID:cpascal,项目名称:win-sshfs,代码行数:36,代码来源:SftpDrive.cs

示例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");
     }
 }
开发者ID:leocheang422,项目名称:win-sshfs,代码行数:21,代码来源:SftpDrive.cs

示例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");
 }
开发者ID:pkubryk,项目名称:SummerBatch,代码行数:9,代码来源:UnexpectedFieldTypeException.cs

示例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");
     }
 }
开发者ID:raggsokk,项目名称:Kraggs.TSM7.Utils,代码行数:15,代码来源:clsTSMMessage.cs

示例9: VirtualDrive

 public VirtualDrive(SerializationInfo info,
     StreamingContext context)
 {
     Letter = info.GetChar("letter");
 }
开发者ID:cpascal,项目名称:win-sshfs,代码行数:5,代码来源:VirtualDrive.cs

示例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;
     }
 }
开发者ID:afonsomota,项目名称:ProjectoPADI,代码行数:13,代码来源:Interfaces.cs


注:本文中的System.Runtime.Serialization.SerializationInfo.GetChar方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。