Ejemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Margin"/> class. 
 /// Copy constructor
 /// </summary>
 /// <param name="rhs">
 /// the <see cref="Margin"/> instance to be copied.
 /// </param>
 public Margin(Margin rhs)
 {
     this._left = rhs._left;
     this._right = rhs._right;
     this._top = rhs._top;
     this._bottom = rhs._bottom;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PaneBase"/> class. 
        /// The Copy Constructor
        /// </summary>
        /// <param name="rhs">
        /// The <see cref="PaneBase"/> object from which to copy
        /// </param>
        public PaneBase(PaneBase rhs)
        {
            // copy over all the value types
            this._isFontsScaled = rhs._isFontsScaled;
            this._isPenWidthScaled = rhs._isPenWidthScaled;

            this._titleGap = rhs._titleGap;
            this._baseDimension = rhs._baseDimension;
            this._margin = rhs._margin.Clone();
            this._rect = rhs._rect;

            // Copy the reference types by cloning
            this._fill = rhs._fill.Clone();
            this._border = rhs._border.Clone();
            this._title = rhs._title.Clone();

            this._legend = rhs.Legend.Clone();
            this._title = rhs._title.Clone();
            this._graphObjList = rhs._graphObjList.Clone();

            if (rhs._tag is ICloneable)
            {
                this._tag = ((ICloneable)rhs._tag).Clone();
            }
            else
            {
                this._tag = rhs._tag;
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PaneBase"/> class. 
        /// Constructor for deserializing objects
        /// </summary>
        /// <param name="info">
        /// A <see cref="SerializationInfo"/> instance that defines the serialized data
        /// </param>
        /// <param name="context">
        /// A <see cref="StreamingContext"/> instance that contains the serialized data
        /// </param>
        protected PaneBase(SerializationInfo info, StreamingContext context)
        {
            // The schema value is just a file version parameter.  You can use it to make future versions
            // backwards compatible as new member variables are added to classes
            int sch = info.GetInt32("schema");

            this._rect = (RectangleF)info.GetValue("rect", typeof(RectangleF));
            this._legend = (Legend)info.GetValue("legend", typeof(Legend));
            this._title = (GapLabel)info.GetValue("title", typeof(GapLabel));

            // this.isShowTitle = info.GetBoolean( "isShowTitle" );
            this._isFontsScaled = info.GetBoolean("isFontsScaled");
            this._isPenWidthScaled = info.GetBoolean("isPenWidthScaled");

            // this.fontSpec = (FontSpec) info.GetValue( "fontSpec" , typeof(FontSpec) );
            this._titleGap = info.GetSingle("titleGap");
            this._fill = (Fill)info.GetValue("fill", typeof(Fill));
            this._border = (Border)info.GetValue("border", typeof(Border));
            this._baseDimension = info.GetSingle("baseDimension");
            this._margin = (Margin)info.GetValue("margin", typeof(Margin));
            this._graphObjList = (GraphObjList)info.GetValue("graphObjList", typeof(GraphObjList));

            this._tag = info.GetValue("tag", typeof(object));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PaneBase"/> class. 
        /// Default constructor for the <see cref="PaneBase"/> class.  Specifies the <see cref="Title"/> of the <see cref="PaneBase"/>, and the size of the
        /// <see cref="Rect"/>.
        /// </summary>
        /// <param name="title">
        /// The title.
        /// </param>
        /// <param name="paneRect">
        /// The pane Rect.
        /// </param>
        public PaneBase(string title, RectangleF paneRect)
        {
            this._rect = paneRect;

            this._legend = new Legend();

            this._baseDimension = Default.BaseDimension;
            this._margin = new Margin();
            this._titleGap = Default.TitleGap;

            this._isFontsScaled = Default.IsFontsScaled;
            this._isPenWidthScaled = Default.IsPenWidthScaled;
            this._fill = new Fill(Default.FillColor);
            this._border = new Border(Default.IsBorderVisible, Default.BorderColor, Default.BorderPenWidth);

            this._title = new GapLabel(
                title,
                Default.FontFamily,
                Default.FontSize,
                Default.FontColor,
                Default.FontBold,
                Default.FontItalic,
                Default.FontUnderline);
            this._title._fontSpec.Fill.IsVisible = false;
            this._title._fontSpec.Border.IsVisible = false;

            this._graphObjList = new GraphObjList();

            this._tag = null;
        }