當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。