当前位置: 首页>>代码示例>>C#>>正文


C# SerializationInfo.GetByte方法代码示例

本文整理汇总了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();
        }
开发者ID:jamafyna,项目名称:park,代码行数:28,代码来源:MainForm.cs

示例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));
     }
 }
开发者ID:uqlpayne,项目名称:UQ-iLab-BatchLabServer-DotNet,代码行数:15,代码来源:SlaveException.cs

示例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);
 }
开发者ID:pi11e,项目名称:KinectHTML5,代码行数:9,代码来源:Extensions.cs

示例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;
        }
开发者ID:Haedrian,项目名称:Divine-Right,代码行数:9,代码来源:ColorSerializationSurrogate.cs

示例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"));
 }
开发者ID:Onkeliroh,项目名称:DSA,代码行数:18,代码来源:DPin.cs

示例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());
 }
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:28,代码来源:CSharpSerializableCompilationOptions.cs

示例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();
 }
开发者ID:hach-que,项目名称:Dx,代码行数:7,代码来源:ID.cs

示例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"));
        }
开发者ID:Onkeliroh,项目名称:DSA,代码行数:21,代码来源:Sequence.cs

示例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);
            }
        }
开发者ID:hpavlov,项目名称:tangra3,代码行数:25,代码来源:StarMapFeature.cs

示例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;
     }
 }
开发者ID:langhuihui,项目名称:csharprtmp,代码行数:26,代码来源:VariantSerialization.cs

示例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());
 }
开发者ID:jerriclynsjohn,项目名称:roslyn,代码行数:33,代码来源:CSharpSerializableCompilationOptions.cs

示例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>));
        }
开发者ID:madrang,项目名称:TiledSharp,代码行数:13,代码来源:Map.Serialize.cs

示例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;
     }
 }
开发者ID:nomoreserious,项目名称:FlowSimulation,代码行数:14,代码来源:ScenarioModel.cs

示例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;
		}
开发者ID:savagemat,项目名称:arcgis-diagrammer,代码行数:16,代码来源:Label.cs

示例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> ();
        }
开发者ID:Onkeliroh,项目名称:DSA,代码行数:29,代码来源:MeasurementCombination.cs


注:本文中的System.Runtime.Serialization.SerializationInfo.GetByte方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。