コード例 #1
0
ファイル: PaneBase.cs プロジェクト: nic0lae/mathtoolbelt
        /// <summary>
        /// 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" );

            _rect = (RectangleF) info.GetValue( "rect", typeof(RectangleF) );
            _legend = (Legend) info.GetValue( "legend", typeof(Legend) );
            _title = (GapLabel) info.GetValue( "title", typeof(GapLabel) );
            //this.isShowTitle = info.GetBoolean( "isShowTitle" );
            _isFontsScaled = info.GetBoolean( "isFontsScaled" );
            _isPenWidthScaled = info.GetBoolean( "isPenWidthScaled" );
            //this.fontSpec = (FontSpec) info.GetValue( "fontSpec" , typeof(FontSpec) );
            _titleGap = info.GetSingle( "titleGap" );
            _fill = (Fill) info.GetValue( "fill", typeof(Fill) );
            _border = (Border) info.GetValue( "border", typeof(Border) );
            _baseDimension = info.GetSingle( "baseDimension" );
            _margin = (Margin)info.GetValue( "margin", typeof( Margin ) );
            _graphObjList = (GraphObjList) info.GetValue( "graphObjList", typeof(GraphObjList) );

            _tag = info.GetValue( "tag", typeof(object) );
        }
コード例 #2
0
ファイル: PaneBase.cs プロジェクト: nic0lae/mathtoolbelt
        /// <summary>
        /// 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>
        public PaneBase( string title, RectangleF paneRect )
        {
            _rect = paneRect;

            _legend = new Legend();

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

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

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

            _graphObjList = new GraphObjList();

            _tag = null;
        }
コード例 #3
0
ファイル: PaneBase.cs プロジェクト: nic0lae/mathtoolbelt
        /// <summary>
        /// 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
            _isFontsScaled = rhs._isFontsScaled;
            _isPenWidthScaled = rhs._isPenWidthScaled;

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

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

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

            if ( rhs._tag is ICloneable )
                _tag = ((ICloneable) rhs._tag).Clone();
            else
                _tag = rhs._tag;
        }
コード例 #4
0
ファイル: Legend.cs プロジェクト: nic0lae/mathtoolbelt
        /// <summary>
        /// The Copy Constructor
        /// </summary>
        /// <param name="rhs">The XAxis object from which to copy</param>
        public Legend( Legend rhs )
        {
            _rect = rhs.Rect;
            _position = rhs.Position;
            _isHStack = rhs.IsHStack;
            _isVisible = rhs.IsVisible;

            _location = rhs.Location;
            _border = rhs.Border.Clone();
            _fill = rhs.Fill.Clone();

            _fontSpec = rhs.FontSpec.Clone();

            _gap = rhs._gap;

            _isReverse = rhs._isReverse;

            _isShowLegendSymbols = rhs._isShowLegendSymbols;
        }