本文整理汇总了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 ();
}
示例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));
}
示例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);
}
示例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();
}
示例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;
}
}
示例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;
}
}
示例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();
}
示例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;
}
}
示例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");
}
示例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));
}
示例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));
}
示例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));
}
示例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));
}
示例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)) ) {
}
示例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;
}
}