当前位置: 首页>>代码示例>>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;未经允许,请勿转载。