Exemplo n.º 1
1
 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));
 }
Exemplo n.º 2
0
 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");
 }
Exemplo n.º 3
0
        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;
            }
        }
Exemplo n.º 4
0
        /// <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");
 }
Exemplo n.º 6
0
 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;
		}
Exemplo n.º 8
0
 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>));
 }
Exemplo n.º 9
0
 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;
 }
Exemplo n.º 10
0
 /// <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;
		}
Exemplo n.º 12
0
 /// <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");
		}
Exemplo n.º 15
0
 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");
 }
Exemplo n.º 16
0
 public Player(SerializationInfo info, 
     StreamingContext context)
 {
     name = info.GetString("PlayerName");
     id = info.GetInt32("PlayerId");
     score = info.GetDouble("Score");
 }
Exemplo n.º 17
0
 /// <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");
 }
Exemplo n.º 18
0
        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);
            }
        }
Exemplo n.º 19
0
    /// <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));


    }
Exemplo n.º 20
0
        /// <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");
    }
Exemplo n.º 23
0
 /// <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;

    }
Exemplo n.º 26
0
 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));
 }
Exemplo n.º 27
0
 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");
    }