/// <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"); this.paneRect = (RectangleF)info.GetValue("paneRect", typeof(RectangleF)); this.legend = (Legend)info.GetValue("legend", typeof(Legend)); this.title = info.GetString("title"); this.isShowTitle = info.GetBoolean("isShowTitle"); this.isFontsScaled = info.GetBoolean("isFontsScaled"); this.isPenWidthScaled = info.GetBoolean("isPenWidthScaled"); this.fontSpec = (FontSpec)info.GetValue("fontSpec", typeof(FontSpec)); this.paneFill = (Fill)info.GetValue("paneFill", typeof(Fill)); this.paneBorder = (Border)info.GetValue("paneBorder", typeof(Border)); this.baseDimension = info.GetSingle("baseDimension"); this.graphItemList = (GraphItemList)info.GetValue("graphItemList", typeof(GraphItemList)); this.marginLeft = info.GetSingle("marginLeft"); this.marginRight = info.GetSingle("marginRight"); this.marginTop = info.GetSingle("marginTop"); this.marginBottom = info.GetSingle("marginBottom"); this.tag = info.GetValue("tag", typeof(object)); }
/// <summary> /// The Copy Constructor /// </summary> /// <param name="rhs">The <see cref="GraphItemList"/> object from which to copy</param> public GraphItemList(GraphItemList rhs) { foreach (GraphItem item in rhs) { this.Add((GraphItem)item.Clone()); } }
/// <summary> /// The Copy Constructor /// </summary> /// <param name="rhs">The <see cref="PaneBase"/> object from which to copy</param> public PaneBase(PaneBase rhs) { this.paneFill = (Fill)rhs.paneFill.Clone(); this.paneBorder = (Border)rhs.paneBorder.Clone(); this.title = (string)rhs.title.Clone(); this.IsShowTitle = rhs.isShowTitle; this.isFontsScaled = rhs.isFontsScaled; this.isPenWidthScaled = rhs.isPenWidthScaled; this.baseDimension = rhs.baseDimension; this.marginLeft = rhs.marginLeft; this.marginRight = rhs.marginRight; this.marginTop = rhs.marginTop; this.marginBottom = rhs.marginBottom; this.paneRect = rhs.paneRect; legend = new Legend(rhs.Legend); this.fontSpec = (FontSpec)rhs.fontSpec.Clone(); this.graphItemList = (GraphItemList)rhs.graphItemList.Clone(); if (rhs.tag is ICloneable) { this.tag = ((ICloneable)rhs.tag).Clone(); } else { this.tag = rhs.tag; } }
/// <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="PaneRect"/>. /// </summary> public PaneBase(string title, RectangleF paneRect) { this.paneRect = paneRect; legend = new Legend(); if (title == null) { this.title = ""; } else { this.title = title; } if (this.title.Length == 0) { this.IsShowTitle = false; } else { this.IsShowTitle = true; } this.baseDimension = Default.BaseDimension; this.marginLeft = Default.MarginLeft; this.marginRight = Default.MarginRight; this.marginTop = Default.MarginTop; this.marginBottom = Default.MarginBottom; this.isFontsScaled = Default.IsFontsScaled; this.isPenWidthScaled = Default.IsPenWidthScaled; this.paneFill = new Fill(Default.FillColor); this.paneBorder = new Border(Default.IsBorderVisible, Default.BorderColor, Default.BorderPenWidth); this.fontSpec = new FontSpec(Default.FontFamily, Default.FontSize, Default.FontColor, Default.FontBold, Default.FontItalic, Default.FontUnderline, Color.White, null, FillType.None); this.fontSpec.Border.IsVisible = false; graphItemList = new GraphItemList(); this.tag = null; }
/// <summary> /// The Copy Constructor /// </summary> /// <param name="rhs">The <see cref="GraphItemList"/> object from which to copy</param> public GraphItemList( GraphItemList rhs ) { foreach ( GraphItemList item in rhs ) this.Add( (GraphItem) item.Clone() ); }
/// <summary> /// The Copy Constructor /// </summary> /// <param name="rhs">The GraphPane object from which to copy</param> public GraphPane( GraphPane rhs ) { paneRect = rhs.PaneRect; xAxis = new XAxis( rhs.XAxis ); yAxis = new YAxis( rhs.YAxis ); y2Axis = new Y2Axis( rhs.Y2Axis ); legend = new Legend( rhs.Legend); curveList = new CurveList( rhs.CurveList ); graphItemList = new GraphItemList( rhs.GraphItemList ); this.title = rhs.Title; this.isShowTitle = rhs.IsShowTitle; this.fontSpec = (FontSpec) rhs.FontSpec.Clone(); this.isIgnoreInitial = rhs.IsIgnoreInitial; this.paneBorder = (Border) rhs.PaneBorder.Clone(); this.paneFill = (Fill) rhs.PaneFill.Clone(); this.isAxisRectAuto = rhs.IsAxisRectAuto; this.axisBorder = (Border) rhs.AxisBorder.Clone(); this.axisFill = (Fill) rhs.AxisFill.Clone(); this.baseDimension = rhs.BaseDimension; this.isFontsScaled = rhs.isFontsScaled; this.isPenWidthScaled = rhs.isPenWidthScaled; this.paneGap = rhs.PaneGap; this.minClusterGap = rhs.MinClusterGap; this.minBarGap = rhs.MinBarGap; this.clusterScaleWidth = rhs.ClusterScaleWidth; this.barBase = rhs.BarBase; this.barType = rhs.BarType; }
/// <summary> /// Constructor for the <see cref="GraphPane"/> object. This routine will /// initialize all member variables and classes, setting appropriate default /// values as defined in the <see cref="Default"/> class. /// </summary> /// <param name="paneRect"> A rectangular screen area where the graph is to be displayed. /// This area can be any size, and can be resize at any time using the /// <see cref="PaneRect"/> property. /// </param> /// <param name="paneTitle">The <see cref="Axis.Title"/> for this <see cref="GraphPane"/></param> /// <param name="xTitle">The <see cref="Axis.Title"/> for the <see cref="XAxis"/></param> /// <param name="yTitle">The <see cref="Axis.Title"/> for the <see cref="YAxis"/></param> public GraphPane( RectangleF paneRect, string paneTitle, string xTitle, string yTitle ) { this.paneRect = paneRect; xAxis = new XAxis( xTitle ); yAxis = new YAxis( yTitle ); y2Axis = new Y2Axis( "" ); legend = new Legend(); curveList = new CurveList(); graphItemList = new GraphItemList(); this.title = paneTitle; this.isShowTitle = Default.IsShowTitle; this.fontSpec = new FontSpec( Default.FontFamily, Default.FontSize, Default.FontColor, Default.FontBold, Default.FontItalic, Default.FontUnderline, Default.FontFillColor, Default.FontFillBrush, Default.FontFillType ); this.fontSpec.Border.IsVisible = false; this.isIgnoreInitial = Default.IsIgnoreInitial; this.paneBorder = new Border( Default.IsPaneBorderVisible, Default.PaneBorderColor, Default.PaneBorderPenWidth ); this.paneFill = new Fill( Default.PaneBackColor, Default.PaneBackBrush, Default.PaneBackType ); this.isAxisRectAuto = true; this.axisBorder = new Border( Default.IsAxisBorderVisible, Default.AxisBorderColor, Default.AxisBorderPenWidth ); this.axisFill = new Fill( Default.AxisBackColor, Default.AxisBackBrush, Default.AxisBackType ); this.baseDimension = Default.BaseDimension; this.paneGap = Default.PaneGap; this.isFontsScaled = true; this.isPenWidthScaled = Default.IsPenWidthScaled; this.minClusterGap = Default.MinClusterGap; this.minBarGap = Default.MinBarGap; this.clusterScaleWidth = Default.ClusterScaleWidth; this.barBase = Default.BarBase; this.barType = Default.BarType; }