當前位置: 首頁>>代碼示例>>C#>>正文


C# SerializationInfo.GetValue方法代碼示例

本文整理匯總了C#中System.Runtime.Serialization.SerializationInfo.GetValue方法的典型用法代碼示例。如果您正苦於以下問題:C# SerializationInfo.GetValue方法的具體用法?C# SerializationInfo.GetValue怎麽用?C# SerializationInfo.GetValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Runtime.Serialization.SerializationInfo的用法示例。


在下文中一共展示了SerializationInfo.GetValue方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Deserialize

		protected override void Deserialize (SerializationInfo info, StreamingContext context)
		{
			text = (string) info.GetValue ("AssemblyName", typeof (AssemblyName));
			base.Filter = (ICollection)info.GetValue ("Filter", typeof (ICollection));
			base.DisplayName = info.GetString ("DisplayName");
			if (info.GetBoolean ("Locked")) base.Lock ();
		}
開發者ID:Kalnor,項目名稱:monodevelop,代碼行數:7,代碼來源:TextToolboxItem.cs

示例2: TimeOfDayChangedAction

 protected TimeOfDayChangedAction(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     v3dLayer = EditorManager.Project.Scene.MainLayer as V3DLayer;
       oldConfig = (TimeOfDay)info.GetValue("oldConfig", typeof(TimeOfDay));
       newConfig = (TimeOfDay)info.GetValue("newConfig", typeof(TimeOfDay));
 }
開發者ID:RexBaribal,項目名稱:projectanarchy,代碼行數:7,代碼來源:TimeOfDayChangedAction.cs

示例3: 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

示例4: Tile

        public Tile(SerializationInfo info, StreamingContext ctx)
            : base(info, ctx)
        {
            m_strName = null;
            try {
                m_strName = info.GetString("Name");
            } catch {
                m_strName = info.GetInt32("Cookie").ToString();
            }

            m_afVisible = (bool[,])info.GetValue("Visibility", typeof(bool[,]));

            try {
                m_afOccupancy = (bool[,])info.GetValue("Occupancy", typeof(bool[,]));
            } catch {
                TemplateDoc tmpd = (TemplateDoc)DocManager.GetActiveDocument(typeof(TemplateDoc));
                Template tmpl = tmpd.FindTemplate(m_strName);
                if (tmpl != null) {
                    m_afOccupancy = tmpl.OccupancyMap;
                } else {
                    m_afOccupancy = new bool[1, 1];
                }
            }

            InitCommon();
        }
開發者ID:RusselRains,項目名稱:hostile-takeover,代碼行數:26,代碼來源:tile.cs

示例5: XmlException

        protected XmlException(SerializationInfo info, StreamingContext context) : base(info, context) {
            res                 = (string)  info.GetValue("res"  , typeof(string));
            args                = (string[])info.GetValue("args", typeof(string[]));
            lineNumber          = (int)     info.GetValue("lineNumber", typeof(int));
            linePosition        = (int)     info.GetValue("linePosition", typeof(int));

            // deserialize optional members
            sourceUri = string.Empty;
            string version = null;
            foreach ( SerializationEntry e in info ) {
                switch ( e.Name ) {
                    case "sourceUri":
                        sourceUri = (string)e.Value;
                        break;
                    case "version":
                        version = (string)e.Value;
                        break;
                }
            }

            if ( version == null ) {
                // deserializing V1 exception
                message = CreateMessage( res, args, lineNumber, linePosition );
            }
            else {
                // deserializing V2 or higher exception -> exception message is serialized by the base class (Exception._message)
                message = null;
            }
        }
開發者ID:iskiselev,項目名稱:JSIL.NetFramework,代碼行數:29,代碼來源:XmlException.cs

示例6: CodePageEncoding

        // Constructor called by serialization.
        internal CodePageEncoding(SerializationInfo info, StreamingContext context)
        {
            // Any info?
            if (info==null) throw new ArgumentNullException(nameof(info));
            Contract.EndContractBlock();

            // All versions have a code page
            this.m_codePage = (int)info.GetValue("m_codePage", typeof(int));

            // See if we have a code page
            try
            {
                //
                // Try Whidbey V2.0 Fields
                //
                this.m_isReadOnly = (bool)info.GetValue("m_isReadOnly", typeof(bool));

                this.encoderFallback = (EncoderFallback)info.GetValue("encoderFallback", typeof(EncoderFallback));
                this.decoderFallback = (DecoderFallback)info.GetValue("decoderFallback", typeof(DecoderFallback));
            }
            catch (SerializationException)
            {
                //
                // Didn't have Whidbey things, must be Everett
                //
                this.m_deserializedFromEverett = true;

                // May as well be read only
                this.m_isReadOnly = true;
            }
        }
開發者ID:kouvel,項目名稱:coreclr,代碼行數:32,代碼來源:CodePageEncoding.cs

示例7: LiveDemoSource

 /// <summary>
 /// Deserialization constructor.
 /// </summary>
 public LiveDemoSource(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     _sessionInformation = (RuntimeDataSessionInformation)info.GetValue("sessionInformation", typeof(RuntimeDataSessionInformation));
     _dataStub = (DataSourceStub)info.GetValue("dataStub", typeof(DataSourceStub));
     Construct();
 }
開發者ID:redrhino,項目名稱:DotNetConnectTerminal,代碼行數:10,代碼來源:LiveDemoDataSource.cs

示例8: SerializableFileRequestOptions

        /// <summary>
        /// Initializes a new instance of the <see cref="SerializableFileRequestOptions"/> class.
        /// </summary>
        /// <param name="info">Serialization information.</param>
        /// <param name="context">Streaming context.</param>
        private SerializableFileRequestOptions(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
            bool? disableContentMD5Validation = (bool?)info.GetValue(DisableContentMD5ValidationName, typeof(bool?));
            TimeSpan? maximumExecutionTime = (TimeSpan?)info.GetValue(MaximumExecutionTimeName, typeof(TimeSpan?));
            TimeSpan? serverTimeout = (TimeSpan?)info.GetValue(ServerTimeoutName, typeof(TimeSpan?));
            bool? storeFileContentMD5 = (bool?)info.GetValue(StoreFileContentMD5Name, typeof(bool?));
            bool? useTransactionalMD5 = (bool?)info.GetValue(UseTransactionalMD5Name, typeof(bool?));

            if (null != disableContentMD5Validation
                || null != maximumExecutionTime
                || null != serverTimeout
                || null != storeFileContentMD5
                || null != useTransactionalMD5)
            {
                this.fileRequestOptions = Transfer_RequestOptions.DefaultFileRequestOptions;

                this.fileRequestOptions.DisableContentMD5Validation = disableContentMD5Validation;
                this.fileRequestOptions.MaximumExecutionTime = maximumExecutionTime;
                this.fileRequestOptions.ServerTimeout = serverTimeout;
                this.fileRequestOptions.StoreFileContentMD5 = storeFileContentMD5;
                this.fileRequestOptions.UseTransactionalMD5 = useTransactionalMD5;
            }
            else
            {
                this.fileRequestOptions = null;
            }
        }
開發者ID:ggais,項目名稱:azure-storage-net-data-movement,代碼行數:33,代碼來源:SerializableFileRequestOptions.cs

示例9: Deserialize

 public static void Deserialize(this IShape shape, SerializationInfo serializationInfo)
 {
     shape.Pen = serializationInfo.GetPen("Pen");
     shape.Brush = serializationInfo.GetBrush("Brush");
     shape.Start = serializationInfo.GetValue<Point>("Start");
     shape.End = serializationInfo.GetValue<Point>("End");
 }
開發者ID:jsikorski,項目名稱:dotnet-paint,代碼行數:7,代碼來源:ShapesSerialization.cs

示例10: PhasorDefinitionBase

 /// <summary>
 /// Creates a new <see cref="PhasorDefinitionBase"/> from serialization parameters.
 /// </summary>
 /// <param name="info">The <see cref="SerializationInfo"/> with populated with data.</param>
 /// <param name="context">The source <see cref="StreamingContext"/> for this deserialization.</param>
 protected PhasorDefinitionBase(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     // Deserialize phasor definition
     m_type = (PhasorType)info.GetValue("type", typeof(PhasorType));
     m_voltageReference = (IPhasorDefinition)info.GetValue("voltageReference", typeof(IPhasorDefinition));
 }
開發者ID:avs009,項目名稱:gsf,代碼行數:12,代碼來源:PhasorDefinitionBase.cs

示例11: Consumable

 public Consumable(SerializationInfo info, StreamingContext ctxt)
     : base(info, ctxt)
 {
     this.consumabletype = (ConsumableType)info.GetValue("consumabletype", typeof(int));
     this.effectiveness = (int)info.GetValue("effectiveness", typeof(int));
     this.count = (int)info.GetValue("count", typeof(int));
 }
開發者ID:ninjeff,項目名稱:SimpleGame,代碼行數:7,代碼來源:Consumable.cs

示例12: WavFile

 public WavFile(SerializationInfo info, StreamingContext ctxt)
 {
     base.Construct(info, ctxt);
     Filename = (string)info.GetValue("Filename", typeof(string));
     Channels = (int)info.GetValue("Channels", typeof(int));
     BitRate = (int)info.GetValue("BitRate", typeof(int));
 }
開發者ID:Cocotus,項目名稱:gurutracker,代碼行數:7,代碼來源:WavFile.cs

示例13: MaskingBehaviourPropertyBag

 public MaskingBehaviourPropertyBag(SerializationInfo info, StreamingContext context)
 {
     this.MaskingChar = (string)info.GetValue(ControlLibConstants.MASKING_CHAR, typeof(string));
     this.MaskingType = (MaskingType)info.GetValue(ControlLibConstants.MASKING_TYPE, typeof(MaskingType));
     this.MaskCharLength = (int)info.GetValue(ControlLibConstants.MASKING_CHAR_LENGTH, typeof(int));
     this.MaskingPosition = (MaskingPosition)info.GetValue(ControlLibConstants.MASKING_POSITION, typeof(MaskingPosition));
 }
開發者ID:krishnarajv,項目名稱:Code,代碼行數:7,代碼來源:MaskingBehaviourPropertyBag.cs

示例14: Font

		private Font (SerializationInfo info, StreamingContext context)
			: this(
			info.GetString("Name"), 
			info.GetSingle("Size"), 
			(FontStyle)info.GetValue("Style", typeof(FontStyle)), 
			(GraphicsUnit)info.GetValue("Unit", typeof(GraphicsUnit)) ) {
		}
開發者ID:calumjiao,項目名稱:Mono-Class-Libraries,代碼行數:7,代碼來源:Font.jvm.cs

示例15: XsltException

 protected XsltException(SerializationInfo info, StreamingContext context) : base(info, context)
 {
     this.res = (string) info.GetValue("res", typeof(string));
     this.args = (string[]) info.GetValue("args", typeof(string[]));
     this.sourceUri = (string) info.GetValue("sourceUri", typeof(string));
     this.lineNumber = (int) info.GetValue("lineNumber", typeof(int));
     this.linePosition = (int) info.GetValue("linePosition", typeof(int));
     string str = null;
     SerializationInfoEnumerator enumerator = info.GetEnumerator();
     while (enumerator.MoveNext())
     {
         SerializationEntry current = enumerator.Current;
         if (current.Name == "version")
         {
             str = (string) current.Value;
         }
     }
     if (str == null)
     {
         this.message = CreateMessage(this.res, this.args, this.sourceUri, this.lineNumber, this.linePosition);
     }
     else
     {
         this.message = null;
     }
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:26,代碼來源:XsltException.cs


注:本文中的System.Runtime.Serialization.SerializationInfo.GetValue方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。