本文整理汇总了C#中System.Runtime.Serialization.SerializationInfo.GetByte方法的典型用法代码示例。如果您正苦于以下问题:C# SerializationInfo.GetByte方法的具体用法?C# SerializationInfo.GetByte怎么用?C# SerializationInfo.GetByte使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Runtime.Serialization.SerializationInfo
的用法示例。
在下文中一共展示了SerializationInfo.GetByte方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MainForm
public MainForm(SerializationInfo si, StreamingContext sc)
{
//todo: odstranit button1
model = (GameRecords)si.GetValue("model", typeof(GameRecords));
view = (View2)si.GetValue("view", typeof(View2));
view.form = this;
playingHeight = si.GetByte("height");
playingWidth = si.GetByte("width");
InitializeComponent();
InitializeTasks();
timerTicks = 0;
IsMdiContainer = true;
accessoriesToolStripMenuItem.Checked = false;
amusform = new AmusementsForm(model, mainDockPanel, amusementsToolStripMenuItem);
pathform = new PathForm(model, pathToolStripMenuItem);
accform = new AccessoriesForm(model, accessoriesToolStripMenuItem);
mapform = new MapForm(model, view, playingWidth, playingHeight);
PrepareFormsStartAppearance(model.currOfferedAmus, model.currOfferedPaths, model.currOfferedOthers, model.images);
amusform.Show(mainDockPanel);
pathform.Show(mainDockPanel);
view.form = this;
mapform.InitializeAfterDeserialization(model, view);
timer.Enabled = true;
MyUpdate();
this.Refresh();
}
示例2: SlaveException
/// <summary>
/// Initializes a new instance of the <see cref="SlaveException"/> class.
/// </summary>
/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"></see> that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext"></see> that contains contextual information about the source or destination.</param>
/// <exception cref="T:System.Runtime.Serialization.SerializationException">The class name is null or <see cref="P:System.Exception.HResult"></see> is zero (0). </exception>
/// <exception cref="T:System.ArgumentNullException">The info parameter is null. </exception>
protected SlaveException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
if (info != null)
{
_slaveExceptionResponse = new SlaveExceptionResponse(info.GetByte(SlaveAddressPropertyName), info.GetByte(FunctionCodePropertyName), info.GetByte(SlaveExceptionCodePropertyName));
}
}
示例3: SetObjectData
public object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
{
Color c = new Color();
c.A = info.GetByte("A");
c.R = info.GetByte("R");
c.G = info.GetByte("G");
c.B = info.GetByte("B");
return new SolidColorBrush(c);
}
示例4: SetObjectData
public object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
{
typeof(Color).GetProperty("A").SetValue(obj, info.GetByte("A"),null);
typeof(Color).GetProperty("B").SetValue(obj, info.GetByte("B"), null);
typeof(Color).GetProperty("G").SetValue(obj, info.GetByte("G"), null);
typeof(Color).GetProperty("R").SetValue(obj, info.GetByte("R"), null);
return null;
}
示例5: DPin
/// <summary>
/// Initializes a new instance of the <see cref="PrototypeBackend.DPin"/> class.
/// </summary>
/// <param name="info">Info.</param>
/// <param name="context">Context.</param>
public DPin(SerializationInfo info, StreamingContext context)
{
Type = (PinType)info.GetByte ("Type");
Mode = (PinMode)info.GetByte ("Mode");
Name = info.GetString ("Name");
Number = info.GetUInt32 ("Number");
AnalogNumber = info.GetInt32 ("AnalogNumber");
SDA = info.GetBoolean ("SDA");
SCL = info.GetBoolean ("SCL");
RX = info.GetBoolean ("RX");
TX = info.GetBoolean ("TX");
PlotColor = new Gdk.Color (info.GetByte ("RED"), info.GetByte ("GREEN"), info.GetByte ("BLUE"));
}
示例6: CSharpSerializableCompilationOptions
private CSharpSerializableCompilationOptions(SerializationInfo info, StreamingContext context)
{
_options = new CSharpCompilationOptions(
outputKind: (OutputKind)info.GetInt32(OutputKindString),
moduleName: info.GetString(ModuleNameString),
mainTypeName: info.GetString(MainTypeNameString),
scriptClassName: info.GetString(ScriptClassNameString),
usings: (string[])info.GetValue(UsingsString, typeof(string[])),
cryptoKeyContainer: info.GetString(CryptoKeyContainerString),
cryptoKeyFile: info.GetString(CryptoKeyFileString),
delaySign: (bool?)info.GetValue(DelaySignString, typeof(bool?)),
optimizationLevel: (OptimizationLevel)info.GetInt32(OptimizeString),
checkOverflow: info.GetBoolean(CheckOverflowString),
allowUnsafe: info.GetBoolean(AllowUnsafeString),
platform: (Platform)info.GetInt32(PlatformString),
generalDiagnosticOption: (ReportDiagnostic)info.GetInt32(GeneralDiagnosticOptionString),
warningLevel: info.GetInt32(WarningLevelString),
specificDiagnosticOptions: ((Dictionary<string, ReportDiagnostic>)info.GetValue(SpecificDiagnosticOptionsString, typeof(Dictionary<string, ReportDiagnostic>))).ToImmutableDictionary(),
concurrentBuild: info.GetBoolean(ConcurrentBuildString),
extendedCustomDebugInformation: info.GetBoolean(ExtendedCustomDebugInformationString),
xmlReferenceResolver: XmlFileResolver.Default,
sourceReferenceResolver: SourceFileResolver.Default,
metadataReferenceResolver: new AssemblyReferenceResolver(MetadataFileReferenceResolver.Default, MetadataFileReferenceProvider.Default),
assemblyIdentityComparer: DesktopAssemblyIdentityComparer.Default,
strongNameProvider: new DesktopStrongNameProvider(),
metadataImportOptions: (MetadataImportOptions)info.GetByte(MetadataImportOptionsString),
features: ((string[])info.GetValue(FeaturesString, typeof(string[]))).AsImmutable());
}
示例7: ID
public ID(SerializationInfo info, StreamingContext context)
{
var bytes = new List<byte>();
for (int i = 0; i < 64; i += 1)
bytes.Add(info.GetByte("k" + i));
this.Bytes = bytes.ToArray();
}
示例8: Sequence
/// <summary>
/// Initializes a new instance of the <see cref="PrototypeBackend.Sequence"/> class.
/// </summary>
/// <param name="info">Info.</param>
/// <param name="context">Context.</param>
public Sequence(SerializationInfo info, StreamingContext context)
{
Pin = new DPin ();
Pin = (DPin)info.GetValue ("Pin", Pin.GetType ());
Name = info.GetString ("Name");
GroupName = info.GetString ("GroupName");
Chain = new List<SequenceOperation> ();
Chain = (List<SequenceOperation>)info.GetValue ("Chain", Chain.GetType ());
Repetitions = info.GetInt32 ("Repetitions");
Color = new Gdk.Color (info.GetByte ("RED"), info.GetByte ("GREEN"), info.GetByte ("BLUE"));
}
示例9: StarMapFeature
public StarMapFeature(SerializationInfo info, StreamingContext context)
{
//m_Stride = info.GetInt32("m_Stride");
//m_BytesPerPixel = info.GetInt32("m_BytesPerPixel");
m_MaxBrightness = info.GetByte("m_MaxBrightness");
m_MaxBrightnessFirstKey = info.GetUInt64("m_MaxBrightnessFirstKey");
m_MaxBrightnessPixels = info.GetInt32("m_MaxBrightnessPixels");
m_Generation = info.GetInt32("m_Generation");
m_Merges = info.GetInt32("m_Merges");
m_FeatureId = info.GetInt32("FeatureId");
m_Intencity = info.GetUInt32("m_Intencity");
int count = info.GetInt32("m_Pixels.Count");
int idx = -1;
m_Pixels = new SortedDictionary<ulong, uint>();
for (int i = 0; i < count; i++)
{
idx++;
ulong key = info.GetUInt64(string.Format("m_Pixels.{0}.Key", idx));
uint val = info.GetUInt32(string.Format("m_Pixels.{0}.Value", idx));
m_Pixels.Add(key, val);
}
}
示例10: Variant
public Variant(SerializationInfo info, StreamingContext context)
{
ValueType = (VariantType)info.GetByte("ValueType");
switch (ValueType)
{
case VariantType.Map:
case VariantType.TypedMap:
Value = info.GetValue("Value", typeof (VariantMap));
break;
case VariantType.ByteArray:
Value = info.GetValue("Value", typeof (byte[]));
break;
case VariantType.Date:
case VariantType.Time:
case VariantType.Timestamp:
Value = info.GetValue("Value", typeof (DateTime));
break;
case VariantType.Null:
case VariantType.Undefined:
Value = null;
break;
default:
Value = info.GetValue("Value",typeof(object));
break;
}
}
示例11: CSharpSerializableCompilationOptions
private CSharpSerializableCompilationOptions(SerializationInfo info, StreamingContext context)
{
this.options = new CSharpCompilationOptions(
outputKind: (OutputKind)info.GetInt32(OutputKindString),
moduleName: info.GetString(ModuleNameString),
mainTypeName: info.GetString(MainTypeNameString),
scriptClassName: info.GetString(ScriptClassNameString),
usings: (string[])info.GetValue(UsingsString, typeof(string[])),
cryptoKeyContainer: info.GetString(CryptoKeyContainerString),
cryptoKeyFile: info.GetString(CryptoKeyFileString),
delaySign: (bool?)info.GetValue(DelaySignString, typeof(bool?)),
optimizationLevel: (OptimizationLevel)info.GetInt32(OptimizeString),
checkOverflow: info.GetBoolean(CheckOverflowString),
allowUnsafe: info.GetBoolean(AllowUnsafeString),
fileAlignment: info.GetInt32(FileAlignmentString),
baseAddress: info.GetUInt64(BaseAddressString),
platform: (Platform)info.GetInt32(PlatformString),
generalDiagnosticOption: (ReportDiagnostic)info.GetInt32(GeneralDiagnosticOptionString),
warningLevel: info.GetInt32(WarningLevelString),
specificDiagnosticOptions: ((Dictionary<string, ReportDiagnostic>)info.GetValue(SpecificDiagnosticOptionsString, typeof(Dictionary<string, ReportDiagnostic>))).ToImmutableDictionary(),
highEntropyVirtualAddressSpace: info.GetBoolean(HighEntropyVirtualAddressSpaceString),
subsystemVersion: SubsystemVersion.Create(info.GetInt32(SubsystemVersionMajorString), info.GetInt32(SubsystemVersionMinorString)),
runtimeMetadataVersion: info.GetString(RuntimeMetadataVersionString),
concurrentBuild: info.GetBoolean(ConcurrentBuildString),
xmlReferenceResolver: XmlFileResolver.Default,
sourceReferenceResolver: SourceFileResolver.Default,
metadataReferenceResolver: MetadataFileReferenceResolver.Default,
metadataReferenceProvider: MetadataFileReferenceProvider.Default,
assemblyIdentityComparer: DesktopAssemblyIdentityComparer.Default,
strongNameProvider: new DesktopStrongNameProvider(),
metadataImportOptions: (MetadataImportOptions)info.GetByte(MetadataImportOptionsString),
features: ((string[])info.GetValue(FeaturesString, typeof(string[]))).AsImmutable());
}
示例12: Map
public Map(SerializationInfo info, StreamingContext context)
{
this.Version = info.GetString("Version");
this.Orientation = (Orientation)info.GetByte("Orientation");
this.Size = (Size)info.GetValue("Size", typeof(Size));
this.TileSize = (Size)info.GetValue("TileSize", typeof(Size));
this.Properties = (Dictionary<string, string>)info.GetValue("Properties", typeof(Dictionary<string, string>));
this.Layers = (Collection<iLayer>)info.GetValue("Layers", typeof(Collection<iLayer>));
this.TileSets = (Collection<TileSet>)info.GetValue("TileSets", typeof(Collection<TileSet>));
}
示例13: MapInfoVM
public MapInfoVM(SerializationInfo info, StreamingContext context)
{
try
{
Key = info.GetString("Key");
Value = info.GetByte("Value");
}
catch (SerializationException ex)
{
System.Diagnostics.Debug.WriteLine(string.Format("Тип: {0} Ошибка:{1} Сообщение:{2}", this.GetType().Name, ex.GetType().Name, ex.Message));
Key = string.Empty;
Value = 0x00;
}
}
示例14: Label
//Creates a new element from the supplied XML.
protected Label(SerializationInfo info, StreamingContext context)
{
SuspendEvents = true;
Text = info.GetString("Text");
Offset = Serialization.Serialize.GetPointF(info.GetString("Offset"));
Opacity = info.GetByte("Opacity");
Color = Color.FromArgb(Convert.ToInt32(info.GetString("Color")));
Visible = info.GetBoolean("Visible");
//Only set if exists eg is not default
if (Serialize.Contains(info,"Font")) SetFont(Serialize.GetFont(info.GetString("Font")));
SuspendEvents = false;
}
示例15: MeasurementCombination
/// <summary>
/// Initializes a new instance of the <see cref="PrototypeBackend.MeasurementCombination"/> class.
/// </summary>
/// <param name="info">Info.</param>
/// <param name="context">Context.</param>
public MeasurementCombination(SerializationInfo info, StreamingContext context)
{
Pins = new List<APin> ();
Pins = (List<APin>)info.GetValue ("Pins", Pins.GetType ());
Name = info.GetString ("Name");
Unit = info.GetString ("Unit");
Color = new Gdk.Color (info.GetByte ("RED"), info.GetByte ("GREEN"), info.GetByte ("BLUE"));
MeanValuesCount = info.GetInt32 ("Interval");
OperationString = info.GetString ("OperationString");
if (!string.IsNullOrEmpty (OperationString) && Pins.Count > 0 && Pins.All (o => o != null))
{
try
{
Operation = OperationCompiler.CompileOperation (OperationString, Pins.Select (o => o.DisplayNumberShort).ToArray<string> ());
} catch (Exception e)
{
throw e;
}
}
Values = new List<DateTimeValue> ();
}