private Spheroid(SerializationInfo info, StreamingContext context) { this.Axis = info.GetDouble("Axis"); this.Flatten = info.GetDouble("Flatten"); this.Name = info.GetString("Name"); this.Type = (SpheroidType)info.GetValue("Type", typeof(SpheroidType)); }
public CCDMatrix(SerializationInfo info, StreamingContext context) { m_CellX = info.GetDouble("m_CellX"); m_CellY = info.GetDouble("m_CellY"); m_Width = info.GetInt32("m_Width"); m_Height = info.GetInt32("m_Height"); }
public AstroPlate(SerializationInfo info, StreamingContext context) { m_ImageWidth = info.GetInt32("m_ImageWidth"); m_ImageHeight = info.GetInt32("m_ImageHeight"); m_MatrixToImageScaleX = info.GetDouble("m_MatrixToImageScaleX"); m_MatrixToImageScaleY = info.GetDouble("m_MatrixToImageScaleY"); EffectiveFocalLength = info.GetDouble("EffectiveFocalLength"); EffectivePixelWidth = info.GetDouble("EffectivePixelWidth"); EffectivePixelHeight = info.GetDouble("EffectivePixelHeight"); byte[] data = (byte[])info.GetValue("m_Matrix", typeof(byte[])); BinaryFormatter fmt = new BinaryFormatter(); using (MemoryStream mem = new MemoryStream(data)) { m_Matrix = (CCDMatrix)fmt.Deserialize(mem); } try { m_BitPix = info.GetInt32("m_BitPix"); } catch { m_BitPix = 8; } }
/// <summary> /// Deserialization Constructor /// </summary> /// <param name="info"> /// Serialization information to deserialize and obtain the data /// </param> /// <param name="context"> /// Serialization context to use /// </param> /// <exception cref="ArgumentNullException"> /// if <c>info</c> is <c>null</c> /// </exception> public AbstractFunction(SerializationInfo info, StreamingContext context) { Helper.ValidateNotNull(info, "info"); this.initialLearningRate = info.GetDouble("initialLearningRate"); this.finalLearningRate = info.GetDouble("finalLearningRate"); }
protected CircularLineTerminal(SerializationInfo info, StreamingContext context) : base(info, context) { _scaleX = info.GetDouble ("Scale-X"); _scaleY = info.GetDouble ("Scale-Y"); _radius = info.GetDouble ("Radius"); }
public ConfigDoR(SerializationInfo info, StreamingContext context) { minX = info.GetDouble("minX"); maxX = info.GetDouble("maxX"); minY = info.GetDouble("minY"); maxY = info.GetDouble("maxY"); }
public object SetObjectData (object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector) { PointD point = (PointD) obj; point.X = info.GetDouble ("Cairo.PointD.X"); point.Y = info.GetDouble ("Cairo.PointD.Y"); return point; }
public ConfigDoI(SerializationInfo info, StreamingContext context) { minX = info.GetDouble("minX"); maxX = info.GetDouble("maxX"); minY = info.GetDouble("minY"); maxY = info.GetDouble("maxY"); relevantComponents = (List<string>)info.GetValue("relevantComponents", typeof(List<string>)); }
public object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector) { Utility.SetPropertyValue(ref obj, "MinX", BindingFlags.Public | BindingFlags.Instance, info.GetDouble("minX")); Utility.SetPropertyValue(ref obj, "MaxX", BindingFlags.Public | BindingFlags.Instance, info.GetDouble("maxX")); Utility.SetPropertyValue(ref obj, "MinY", BindingFlags.Public | BindingFlags.Instance, info.GetDouble("minY")); Utility.SetPropertyValue(ref obj, "MaxY", BindingFlags.Public | BindingFlags.Instance, info.GetDouble("maxY")); return obj; }
/// <summary> /// Creates a new <see cref="ConfigurationCell"/> 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 ConfigurationCell(SerializationInfo info, StreamingContext context) : base(info, context) { // Deserialize configuration cell m_timeOffset = info.GetInt64("timeOffset"); m_longitude = info.GetDouble("longitude"); m_latitude = info.GetDouble("latitude"); m_numberOfSatellites = info.GetInt32("numberOfSatellites"); }
public object SetObjectData (object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector) { Color color = (Color) obj; color.A = info.GetDouble ("Cairo.Color.A"); color.R = info.GetDouble ("Cairo.Color.R"); color.G = info.GetDouble ("Cairo.Color.G"); color.B = info.GetDouble ("Cairo.Color.B"); return color; }
/// <summary> /// Initializes a new instance of the <see cref="Network" /> class. Used by the Serializer /// </summary> /// <param name='info'> /// Info. /// </param> /// <param name='context'> /// Context. /// </param> public Network(SerializationInfo info, StreamingContext context) { _LearningRate = 0; _CurrentLayers = (List<Base>) info.GetValue("CurrentLayers", typeof (List<Base>)); _LearningRate = info.GetDouble("_LearningRate"); _Momenum = info.GetDouble("_Momenum"); _LastIssuedLayerID = info.GetInt32("_LastIssuedLayerID"); _DetectedBottomLayers = (List<Base>) info.GetValue("_DetectedBottomLayers", typeof (List<Base>)); _DetectedTopLayers = (List<Base>) info.GetValue("_DetectedTopLayers", typeof (List<Base>)); }
public RoutineFixtureReferencePoint(SerializationInfo info, StreamingContext ctxt) { _name = info.GetString("_name"); double ellX = info.GetDouble("_ellipseX"); double ellY = info.GetDouble("_ellipseY"); CreateEllipse(ellX, ellY); CreateLabel(info.GetString("_labelContent"), ellX,ellY); _parent = (RoutineFixture)info.GetValue("_parent", typeof(RoutineFixture)); _visible = info.GetBoolean("_visible"); }
protected SimpleTextFigure (SerializationInfo info, StreamingContext context) : base (info, context) { FontColor = (Cairo.Color) info.GetValue ("FontColor", typeof (Cairo.Color)); FontAlignment = (Pango.Alignment) info.GetValue ("FontAlignment", typeof (Pango.Alignment)); FontFamily = (string) info.GetValue ("FontFamily", typeof (string)); FontSize = info.GetInt32 ("FontSize"); FontStyle = (Pango.Style) info.GetValue ("FontStyle", typeof (Pango.Style)); _displayBox = (RectangleD) info.GetValue ("DisplayBox", typeof (RectangleD)); _text = (string) info.GetValue ("Text", typeof (string)); _textEditable = info.GetBoolean ("TextEditable"); _paddingLeft = info.GetDouble ("PaddingLeft"); _paddingTop = info.GetDouble ("PaddingTop"); _paddingRight = info.GetDouble ("PaddingRight"); _paddingBottom = info.GetDouble ("PaddingBottom"); }
public Settings(SerializationInfo info, StreamingContext ctxt) { ProfileName = (string) info.GetValue("profilename", typeof (string)); MarginThreshold = (double) info.GetValue("marginthreshold", typeof (double)); MinimumThreshold = (double) info.GetValue("minimumthreshold", typeof (double)); Accounting = (int) info.GetValue("accounting", typeof (int)); BrokerRelations = (int) info.GetValue("brokerrelations", typeof (int)); FactionStanding = (double) info.GetValue("factionstanding", typeof (double)); CorpStanding = (double) info.GetValue("corpstanding", typeof (double)); AdvancedStepSettings = info.GetBoolean("advancedstepsettings"); BuyPercentage = info.GetDouble("buypercentage"); BuyThreshold = info.GetDouble("buythreshold"); SellPercentage = info.GetDouble("sellpercentage"); SellThreshold = info.GetDouble("sellthreshold"); }
public Player(SerializationInfo info, StreamingContext context) { name = info.GetString("PlayerName"); id = info.GetInt32("PlayerId"); score = info.GetDouble("Score"); }
/// <summary> /// Initializes a new instance of the <see cref="RecurrentContext" /> class. Used by the Serializer. /// </summary> /// <param name='info'> /// Info. /// </param> /// <param name='context'> /// Context. /// </param> public RecurrentContext(SerializationInfo info, StreamingContext context) : base(info, context) { _SourceNode = (Base) info.GetValue("_SourceNode", typeof (Base)); _RateOfUpdate = info.GetDouble("_RateOfUpdate"); _StartValue = info.GetDouble("_StartValue"); }
public DirectTransRotAstrometry(SerializationInfo info, StreamingContext context) { EtaRadians = info.GetDouble("EtaRadians"); m_RA0Deg = info.GetDouble("m_RA0Deg"); m_DE0Deg = info.GetDouble("m_DE0Deg"); m_EtaDeg = info.GetDouble("m_EtaDeg"); m_Aspect = info.GetDouble("m_Aspect"); byte[] data = (byte[])info.GetValue("m_Image", typeof(byte[])); BinaryFormatter fmt = new BinaryFormatter(); using (MemoryStream mem = new MemoryStream(data)) { m_Image = (AstroPlate)fmt.Deserialize(mem); } }
/// <summary> /// Deserialization constructor /// </summary> /// <param name="info">The info.</param> /// <param name="context">The context.</param> protected Page(SerializationInfo info, StreamingContext context) { if (Tracing.BinaryDeserializationSwitch.Enabled) Trace.WriteLine("Deserializing the fields of 'Page'."); double version = info.GetDouble("PageVersion"); Ambience = info.GetValue( "Ambience", typeof(Ambience)) as Ambience; //mDefaultLayer = info.GetValue("DefaultLayer", typeof(ILayer)) as ILayer; mLayers = info.GetValue( "Layers", typeof(CollectionBase<ILayer>)) as CollectionBase<ILayer>; mName = (string)info.GetValue( "Name", typeof(string)); mOrigin = (Point)info.GetValue( "Origin", typeof(Point)); mMagnification = (SizeF)info.GetValue( "Magnification", typeof(SizeF)); }
/// <summary> /// Deserialization Constructor /// </summary> /// <param name="info"> /// Serialization information to deserialize and obtain the data /// </param> /// <param name="context"> /// Serialization context to use /// </param> /// <exception cref="ArgumentNullException"> /// If <c>info</c> is <c>null</c> /// </exception> public RandomFunction(SerializationInfo info, StreamingContext context) { Helper.ValidateNotNull(info, "info"); this.minLimit = info.GetDouble("minLimit"); this.maxLimit = info.GetDouble("maxLimit"); }
// ------------------------------------------------------------------ /// <summary> /// Deserialization constructor /// </summary> /// <param name="info">The info.</param> /// <param name="context">The context.</param> // ------------------------------------------------------------------ protected TextStyle( SerializationInfo info, StreamingContext context) { if (Tracing.BinaryDeserializationSwitch.Enabled) { Trace.WriteLine("Deserializing the fields of 'TextStyle'."); } double version = info.GetDouble("TextStyleVersion"); mDecimalPlaces = info.GetInt32("DecimalPlaces"); mTextFormat = (TextFormat)info.GetValue( "TextFormat", typeof(TextFormat)); mFont = (Font)info.GetValue( "Font", typeof(Font)); mFontColor = (Color)info.GetValue( "FontColor", typeof(Color)); mHorizontalAlignment = (StringAlignment)info.GetValue( "HorizontalAlignment", typeof(StringAlignment)); mVerticalAlignment = (StringAlignment)info.GetValue( "VerticalAlignment", typeof(StringAlignment)); }
/// <summary> /// Deserialization constructor /// </summary> /// <param name="info">The info.</param> /// <param name="context">The context.</param> protected ClickableLabelMaterial(SerializationInfo info, StreamingContext context) : base(info, context) { if (Tracing.BinaryDeserializationSwitch.Enabled) Trace.WriteLine("Deserializing the fields of 'ClickableLabelMaterial'."); double version = info.GetDouble("ClickableLabelMaterialVersion"); }
/// <summary> /// Creates a new <see cref="FrequencyDefinitionBase"/> 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 FrequencyDefinitionBase(SerializationInfo info, StreamingContext context) : base(info, context) { // Deserialize frequency definition m_dfdtScale = info.GetUInt32("dfdtScale"); m_dfdtOffset = info.GetDouble("dfdtOffset"); }
/// <summary> /// Deserialization constructor /// </summary> /// <param name="info">The info.</param> /// <param name="context">The context.</param> protected SimpleEllipse(SerializationInfo info, StreamingContext context) : base(info, context) { if (Tracing.BinaryDeserializationSwitch.Enabled) Trace.WriteLine("Deserializing the fields of 'SimpleEllipse'."); double version = info.GetDouble("SimpleEllipseVersion"); }
// ------------------------------------------------------------------ /// <summary> /// Deserialization constructor /// </summary> /// <param name="info">The info.</param> /// <param name="context">The context.</param> // ------------------------------------------------------------------ protected ConnectionBase( SerializationInfo info, StreamingContext context) : base(info, context) { if (Tracing.BinaryDeserializationSwitch.Enabled) { Trace.WriteLine( "Deserializing the fields of 'ConnectionBase'."); } double version = info.GetDouble("ConnectionBaseVersion"); mTo = info.GetValue("To", typeof(Connector)) as Connector; mFrom = info.GetValue("From", typeof(Connector)) as Connector; if (mTo == null) { throw new InconsistencyException( "'To' connector deserialized to 'null'"); } if (mFrom == null) { throw new InconsistencyException( "'From' connector deserialized to 'null'"); } mTo.Parent = this; mFrom.Parent = this; }
private DatasetOverlayResultSetting(SerializationInfo info, StreamingContext context) { this.Tolerance = info.GetDouble("Tolerance"); this.SourceDatasetFields = (string[])info.GetValue("SourceDatasetFields", typeof(string[])); this.OperateDatasetFields = (string[])info.GetValue("OperateDatasetFields", typeof(string[])); this.DataReturnOption = (DataReturnOption)info.GetValue("DataReturnOption", typeof(DataReturnOption)); }
public object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector) { var res = (Resolution)obj; res.Id = info.GetString("id"); res.UnitsPerPixel = info.GetDouble("upp"); return res; }
// ------------------------------------------------------------------- /// <summary> /// Deserialization constructor /// </summary> /// <param name="info">The info.</param> /// <param name="context">The context.</param> // ------------------------------------------------------------------- protected ShapeBase( SerializationInfo info, StreamingContext context) : base(info, context) { if (Tracing.BinaryDeserializationSwitch.Enabled) { Trace.WriteLine("Deserializing the fields of 'ShapeBase'."); } double version = info.GetDouble("ShapeBaseVersion"); mConnectors = new CollectionBase<IConnector>(); //transform to the new bounding rectangle Transform( (Rectangle)info.GetValue("Rectangle", typeof(Rectangle)) ); this.mConnectors = info.GetValue( "Connectors", typeof(CollectionBase<IConnector>)) as CollectionBase<IConnector>; mShowConnectors = info.GetBoolean("ShowConnectors"); mIsFixed = info.GetBoolean("IsFixed"); }
// ------------------------------------------------------------------- /// <summary> /// Deserialization constructor /// </summary> /// <param name="info">The info.</param> /// <param name="context">The context.</param> // ------------------------------------------------------------------- protected SimpleShapeBase( SerializationInfo info, StreamingContext context) : base(info, context) { if (Tracing.BinaryDeserializationSwitch.Enabled) { Trace.WriteLine( "Deserializing the fields of 'SimpleShapeBase'."); } double version = info.GetDouble("SimpleShapeBaseVersion"); mText = info.GetString("Text"); mAutoSize = info.GetBoolean("AutoSize"); mAllowTextEditing = info.GetBoolean("AllowTextEditing"); mEditTextClicks = info.GetInt32("EditTextClicks"); mTextArea = (Rectangle)info.GetValue( "TextArea", typeof(Rectangle)); mTextStyle = (ITextStyle)info.GetValue( "TextStyle", typeof(ITextStyle)); }
/// <summary> /// Deserialization constructor /// </summary> /// <param name="info">The info.</param> /// <param name="context">The context.</param> private Connection(SerializationInfo info, StreamingContext context) : base(info, context) { if (Tracing.BinaryDeserializationSwitch.Enabled) Trace.WriteLine("Deserializing the fields of 'Connection'."); double version = info.GetDouble("ConnectionVersion"); }