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