Beispiel #1
0
        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();
        }
 /// <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));
     }
 }
        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;
        }
Beispiel #4
0
 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);
 }
Beispiel #5
0
 /// <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"));
 }
Beispiel #6
0
        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);
            }
        }
 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());
 }
 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;
     }
 }
Beispiel #9
0
Datei: ID.cs Projekt: hach-que/Dx
 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();
 }
 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());
 }
Beispiel #11
0
        /// <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"));
        }
Beispiel #12
0
        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>));
        }
 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;
     }
 }
Beispiel #14
0
        /// <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> ();
        }
Beispiel #15
0
		//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;
		}
Beispiel #16
0
		//Creates a new element from the supplied XML.
		protected Layer(SerializationInfo info, StreamingContext context)
		{
			SuspendEvents = true;
			
			Opacity = info.GetByte("Opacity");
			Visible = info.GetBoolean("Visible");
			Name = info.GetString("Name");
			DrawShadows = info.GetBoolean("DrawShadows");
			ShadowOffset = Serialize.GetPointF(info.GetString("ShadowOffset"));
			ShadowColor = Color.FromArgb(Convert.ToInt32(info.GetString("ShadowColor")));
			SoftShadows = info.GetBoolean("SoftShadows");

			Elements = (LayerElements) info.GetValue("Elements",typeof(Elements));

			SuspendEvents = false;
		}
Beispiel #17
0
 public SftpDrive(SerializationInfo info,
                  StreamingContext context)
 {
     Name = info.GetString("name");
     Host = info.GetString("host");
     Port = info.GetInt32("port");
     Letter = info.GetChar("drive");
     Root = info.GetString("path");
     Automount = info.GetBoolean("mount");
     Username = info.GetString("user");
     try {
       ProxyType = info.GetInt32("proxyType");
       ProxyHost = info.GetString("proxyHost");
       ProxyUser = info.GetString("proxyUser");
       ProxyPass = info.GetString("proxyPass");
     }
     catch { }
     ConnectionType = (ConnectionType) info.GetByte("c");
     if (ConnectionType == ConnectionType.Password)
     {
         Password = Utilities.UnprotectString(info.GetString("p"));
     }
     else
     {
         Passphrase = Utilities.UnprotectString(info.GetString("p"));
         PrivateKey = info.GetString("k");
     }
     try
     {
         MountPoint = info.GetString("mountpoint");
     }
     catch
     {
         MountPoint = Name;//default is name after version update
     }
 }
Beispiel #18
0
 public SftpDrive(SerializationInfo info,
                  StreamingContext context)
 {
     Name = info.GetString("name");
     Host = info.GetString("host");
     Port = info.GetInt32("port");
     Letter = info.GetChar("drive");
     Root = info.GetString("path");
     Automount = info.GetBoolean("mount");
     Username = info.GetString("user");
     ConnectionType = (ConnectionType) info.GetByte("c");
     if (ConnectionType == ConnectionType.Password)
     {
         Password = Utilities.UnprotectString(info.GetString("p"));
     }
     else
     {
         Passphrase = Utilities.UnprotectString(info.GetString("p"));
         PrivateKey = info.GetString("k");
     }
 }
 private ChangeTriggerStatusAction(SerializationInfo info, StreamingContext context)
 {
     Status = (TriggerStatus) info.GetByte("Status");
 }
Beispiel #20
0
 public ReportWizardSetting(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
 {
     try
     {
         _CategoryDataType = info.GetByte("_CategoryDataType");
     }
     catch
     {
         _CategoryDataType = 0;
     }
     try
     {
         _TemplateType = info.GetByte("_TemplateType");
     }
     catch
     {
         _TemplateType = 0;
     }
     try
     {
         _AddScFilters = info.GetBoolean("_AddScFilters");
     }
     catch
     {
         _AddScFilters = false;
     }
     try
     {
         _AddWatermark = info.GetBoolean("_AddWatermark");
     }
     catch
     {
         _AddWatermark = false;
     }
     try
     {
         _SelectedStyleName = info.GetString("_SelectedStyleName");
     }
     catch
     {
         _SelectedStyleName = string.Empty;
     }
     try
     {
         _GroupTemplateType = info.GetByte("_GroupTemplateType");
     }
     catch
     {
         _GroupTemplateType = 0;
     }
     try
     {
         _CreateByWizard = info.GetBoolean("_CreateByWizard");
     }
     catch
     {
         _CreateByWizard = false;
     }
     try
     {
         _HeaderStyleName = info.GetString("_HeaderStyleName");
     }
     catch
     {
         _HeaderStyleName = string.Empty;
     }
     try
     {
         _GameListStyleName = info.GetString("_GameListStyleName");
     }
     catch
     {
         _GameListStyleName = string.Empty;
     }
     try
     {
         _ProductTypes = info.GetInt32("_ProductTypes");
     }
     catch
     {
         _ProductTypes = (int)WebbDBTypes.WebbAdvantageFootball;
     }
 }
Beispiel #21
0
 /// <summary>
 /// Creates a new <see cref="HeaderCell"/> 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 HeaderCell(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     // Deserialize header cell value
     m_character = info.GetByte("character");
 }
Beispiel #22
0
 /// <summary>
 /// Creates a new <see cref="CommandCell"/> 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 CommandCell(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     // Deserialize command cell value
     m_extendedDataByte = info.GetByte("extendedDataByte");
 }
Beispiel #23
0
        public void GetObjectData_SerializationInfo_AreEqual()
        {
            ISerializable obj = TestStruct;
            var info = new SerializationInfo(typeof(Month), new System.Runtime.Serialization.FormatterConverter());
            obj.GetObjectData(info, default(StreamingContext));

            Assert.AreEqual((Byte)2, info.GetByte("Value"));
        }
Beispiel #24
0
		public Action( SerializationInfo SerializationInfo, StreamingContext StreamingContext )
		{
			ActionType                     = (ActionType)SerializationInfo.GetByte("at");
			WorkingDirectory               = SerializationInfo.GetString("wd");
			bPrintDebugInfo                = SerializationInfo.GetBoolean("di");
			CommandPath                    = SerializationInfo.GetString("cp");
			CommandArguments               = SerializationInfo.GetString("ca");
			CommandDescription             = SerializationInfo.GetString("cd");
			StatusDescription              = SerializationInfo.GetString("sd");
			bCanExecuteRemotely            = SerializationInfo.GetBoolean("ce");
			bIsGCCCompiler                 = SerializationInfo.GetBoolean("ig");
			bIsUsingPCH                    = SerializationInfo.GetBoolean("iu");
			bShouldDeleteProducedItems     = SerializationInfo.GetBoolean("dp");
			bShouldOutputStatusDescription = SerializationInfo.GetBoolean("os");
			bProducesImportLibrary         = SerializationInfo.GetBoolean("il");
			PrerequisiteItems              = (List<FileItem>)SerializationInfo.GetValue("pr", typeof(List<FileItem>));
			ProducedItems                  = (List<FileItem>)SerializationInfo.GetValue("pd", typeof(List<FileItem>));
		}
Beispiel #25
0
 /// <summary>
 /// Creates a new <see cref="DataCell"/> 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 DataCell(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     // Deserialize data cell
     m_status2Flags = info.GetByte("status2Flags");
     m_clockStatusFlags = (ClockStatusFlags)info.GetValue("clockStatusFlags", typeof(ClockStatusFlags));
     m_sampleNumber = info.GetUInt16("sampleNumber");
 }
 /// <summary>
 /// Initializes a new instance of the ScsiCommandException class.
 /// </summary>
 /// <param name="info">The serialization info.</param>
 /// <param name="context">Ther context.</param>
 protected ScsiCommandException(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     _status = (ScsiStatus)info.GetByte("status");
     _senseData = (byte[])info.GetValue("senseData", typeof(byte[]));
 }
Beispiel #27
0
 protected Cpu(SerializationInfo info, StreamingContext ctx) : this()
 {
     A = info.GetByte("A");
     B = info.GetByte("B");
     C = info.GetByte("C");
     D = info.GetByte("D");
     E = info.GetByte("E");
     F = info.GetByte("F");
     H = info.GetByte("H");
     L = info.GetByte("L");
     SP = info.GetUInt16("SP");
     PC = info.GetUInt16("PC");
     IME = info.GetBoolean("IME");
 }
 /// <summary>
 /// Called when deserializing
 /// </summary>
 /// <param name="info"></param>
 /// <param name="context"></param>
 protected ProjectorShape(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     _textureFile = info.GetString("_textureFile");
       _transp = (TransparencyType)info.GetValue("_transp",typeof(TransparencyType));
       _fConeAngleX = info.GetSingle("_fConeAngleX");
       _fConeAngleY = info.GetSingle("_fConeAngleY");
       _fLength = info.GetSingle("_fLength");
       _fFadeOutDist = info.GetSingle("_fFadeOutDist");
       _iIntensity = info.GetByte("_iIntensity");
       _color = (Color)info.GetValue("_color",typeof(Color));
       if (SerializationHelper.HasElement(info,"_bLightmapped"))
     _bLightmapped = info.GetBoolean("_bLightmapped");
       if (SerializationHelper.HasElement(info, "_geomTypeFilter"))
     _geomTypeFilter = (GeometryTypeMask)info.GetValue("_geomTypeFilter", typeof(GeometryTypeMask));
       else _geomTypeFilter = GeometryTypeMask.All; // backwards compatibility
       if (SerializationHelper.HasElement(info, "_fFarClipDistance"))
     _fFarClipDistance = info.GetSingle("_fFarClipDistance");
       // backwards compatibility
       if (!SerializationHelper.HasElement(info, "SupportScaling"))
     SetScaling_Internal(1.0f, 1.0f, 1.0f);
       if (SerializationHelper.HasElement(info, "_iInfluenceBitmask"))
     _iInfluenceBitmask = (FlagsInt32_e)info.GetValue("_iInfluenceBitmask", typeof(FlagsInt32_e));
       else
     _iInfluenceBitmask = FlagsInt32_e.All;
       if (SerializationHelper.HasElement(info, "_shaderFX"))
     _shaderFX = (ShaderEffectConfig)info.GetValue("_shaderFX", typeof(ShaderEffectConfig));
 }
Beispiel #29
0
		///
		private void SetObjectData(SerializationInfo info, StreamingContext context)
		{
			_maxRunned = info.GetByte("_maxRunned");
			_checkRunTimeInterval = info.GetByte("_checkRunTimeInterval");
			_useExternalPulse = info.GetBoolean("_useExternalPulse");
			SchedulerTask[] arr = (SchedulerTask[])info.GetValue("_tasks", typeof(SchedulerTask[]));
			if(_tasks == null)
				_tasks = new IndexedList<SchedulerTask, OID>("OID");
			_tasks.Add(arr);
			if(_useExternalPulse == false)
				_timer = new Timer(Pulse, null, Timeout.Infinite, Timeout.Infinite);
		}
Beispiel #30
0
 private NumericType(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     Precision = info.GetInt32("Precision");
     Scale = info.GetByte("Scale");
 }
		/// <summary>
		/// Read this GraphicsPath from the given SerializationInfo.
		/// </summary>
		/// <param name="obj">The object to populate.</param>
		/// <param name="info">The SerializationInfo to read from.</param>
		/// <param name="context">The StreamingContext of this serialization operation.</param>
		/// <param name="selector">
		/// The surrogate selector where the search for a compatible surrogate begins.
		/// </param>
		/// <returns>The populated deserialized object.</returns>
		public Object SetObjectData(Object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector) {
			GraphicsPath path;
			FillMode fillMode = (FillMode)info.GetValue("fillMode", typeof(FillMode));

			int pointCount = info.GetInt32("pointCount");
			if (pointCount > 0) {
				PointF[] points = new PointF[pointCount];
				byte[] types = new byte[pointCount];

				for(int i = 0; i < pointCount; i++) {
					points[i] = (PointF)info.GetValue("pt" + i, typeof(PointF));
					types[i] = info.GetByte("type" + i);
				}

				path = new GraphicsPath(points, types, fillMode);
			}
			else {
				path = new GraphicsPath(fillMode);
			}

			return path;
		}