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


C# SerializationInfo.GetString方法代码示例

本文整理汇总了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");
 }
开发者ID:40a,项目名称:PowerShell,代码行数:15,代码来源:MshArgumentException.cs

示例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);
 }
开发者ID:redrhino,项目名称:DotNetConnectTerminal,代码行数:11,代码来源:YahooStockDataSource.cs

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

示例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));
		}
开发者ID:pjeconde,项目名称:CedForecast,代码行数:14,代码来源:BaseApplicationException.cs

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

示例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;
 }
开发者ID:TheAaltoWindrawTeam,项目名称:AaltoWindraw,代码行数:15,代码来源:Drawing.cs

示例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");
 }
开发者ID:40a,项目名称:PowerShell,代码行数:15,代码来源:RuntimeException.cs

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

示例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");
			}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:8,代码来源:ConfigurationException.cs

示例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);
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:17,代码来源:Uri.cs

示例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));
			}
		}
开发者ID:uQr,项目名称:Visual-NHibernate,代码行数:20,代码来源:UserOption.cs

示例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);
 }
开发者ID:anshita-arya,项目名称:roslyn,代码行数:11,代码来源:DiagnosticAnalyzerTests.cs

示例14: GlobalDefine

		protected GlobalDefine( SerializationInfo info, StreamingContext context )
		{
			define = info.GetString( "define" );
			enabled = info.GetBoolean( "enabled" );
		}
开发者ID:geechs-anakanishi,项目名称:P31UnityAddOns,代码行数:5,代码来源:GlobalDefinesWizard.cs

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


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