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


C# SerializationInfo.GetString方法代码示例

本文整理汇总了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);
        }
开发者ID:uQr,项目名称:Visual-NHibernate,代码行数:29,代码来源:Lookup.cs

示例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);
		}
开发者ID:khaliyo,项目名称:Spring.net-NHibernate.net-Asp.net-MVC-DWZ-,代码行数:26,代码来源:ProxyObjectReference.cs

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

示例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;
 }
开发者ID:vitska,项目名称:simpleDLNA,代码行数:32,代码来源:VideoFile.cs

示例5: InRangeException

 /// <inheritdoc/>
 protected InRangeException(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     actual = info.GetString("Actual");
     high = info.GetString("High");
     low = info.GetString("Low");
 }
开发者ID:paulecoyote,项目名称:xunit,代码行数:8,代码来源:InRangeException.cs

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

示例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;
        }
开发者ID:slieser,项目名称:LinFu,代码行数:31,代码来源:ProxyObjectReference.cs

示例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[]));
		}
开发者ID:jack-pappas,项目名称:mono,代码行数:7,代码来源:MissingMemberException.cs

示例9: RevokeRoleStatement

 public RevokeRoleStatement(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     Grantee = info.GetString("Grantee");
     RoleName = info.GetString("Role");
     Admin = info.GetBoolean("Admin");
 }
开发者ID:deveel,项目名称:deveeldb,代码行数:7,代码来源:RevokeRoleStatement.cs

示例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;
        }
开发者ID:Haedrian,项目名称:Divine-Right,代码行数:7,代码来源:PointSerializationSurrogate.cs

示例11: ErrorDetails

 protected ErrorDetails(SerializationInfo info, StreamingContext context)
 {
     this._message = "";
     this._recommendedAction = "";
     this._message = info.GetString("ErrorDetails_Message");
     this._recommendedAction = info.GetString("ErrorDetails_RecommendedAction");
 }
开发者ID:nickchal,项目名称:pash,代码行数:7,代码来源:ErrorDetails.cs

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

示例13: QueueCacheMissException

 public QueueCacheMissException(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     Requested = info.GetString("Requested");
     Low = info.GetString("Low");
     High = info.GetString("High");
 }
开发者ID:osjimenez,项目名称:orleans,代码行数:7,代码来源:QueueCacheMissException.cs

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

示例15: StringData

        protected StringData(SerializationInfo si, StreamingContext ctx)
        {
            //从流中得到合并的成员变量
            dataItemOne = si.GetString("First_Item").ToLower();
            dataItemTwo = si.GetString("Second_Item").ToLower();

        }
开发者ID:red201432,项目名称:CSharpLearn,代码行数:7,代码来源:StringData.cs


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