/// <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 PieItem( SerializationInfo info, StreamingContext context ) : base(info, 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( "schema2" ); _displacement = info.GetDouble( "displacement" ); _labelDetail = (TextObj)info.GetValue( "labelDetail", typeof( TextObj ) ); _fill = (Fill)info.GetValue( "fill", typeof( Fill ) ); _border = (Border)info.GetValue( "border", typeof( Border ) ); _pieValue = info.GetDouble( "pieValue" ); _labelType = (PieLabelType)info.GetValue( "labelType", typeof( PieLabelType ) ); _intersectionPoint = (PointF)info.GetValue( "intersectionPoint", typeof( PointF ) ); _boundingRectangle = (RectangleF)info.GetValue( "boundingRectangle", typeof( RectangleF ) ); _pivotPoint = (PointF)info.GetValue( "pivotPoint", typeof( PointF ) ); _endPoint = (PointF)info.GetValue( "endPoint", typeof( PointF ) ); // _slicePath = (GraphicsPath)info.GetValue( "slicePath", typeof( GraphicsPath ) ); _startAngle = (float)info.GetDouble( "startAngle" ); _sweepAngle = (float)info.GetDouble( "sweepAngle" ); _midAngle = (float)info.GetDouble( "midAngle" ); _labelStr = info.GetString( "labelStr" ); _valueDecimalDigits = info.GetInt32( "valueDecimalDigits" ); _percentDecimalDigits = info.GetInt32( "percentDecimalDigits" ); }
/// <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 BoxObj( SerializationInfo info, StreamingContext context ) : base(info, 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( "schema2" ); _fill = (Fill) info.GetValue( "fill", typeof(Fill) ); _border = (Border) info.GetValue( "border", typeof(Border) ); }
/// <summary> /// The Copy Constructor /// </summary> /// <param name="rhs">The Line object from which to copy</param> public Line( Line rhs ) : base(rhs) { _color = rhs._color; _stepType = rhs._stepType; _isSmooth = rhs._isSmooth; _smoothTension = rhs._smoothTension; _fill = rhs._fill.Clone(); _isOptimizedDraw = rhs._isOptimizedDraw; }
/// <summary> /// Create a fill brush using current properties. This method will construct a brush based on the /// settings of <see cref="ZedGraph.Fill.Type"/>, <see cref="ZedGraph.Fill.Color"/> /// and <see cref="ZedGraph.Fill.Brush"/>. If /// <see cref="ZedGraph.Fill.Type"/> is set to <see cref="ZedGraph.FillType.Brush"/> and /// <see cref="ZedGraph.Fill.Brush"/> /// is null, then a <see cref="LinearGradientBrush"/> will be created between the colors of /// <see cref="System.Drawing.Color.White"/> and <see cref="ZedGraph.Fill.Color"/>. /// </summary> /// <param name="rect">A rectangle that bounds the object to be filled. This determines /// the start and end of the gradient fill.</param> /// <param name="dataValue">The data value to be used for a value-based /// color gradient. This is only applicable for <see cref="FillType.GradientByX"/>, /// <see cref="FillType.GradientByY"/> or <see cref="FillType.GradientByZ"/>.</param> /// <returns>A <see cref="System.Drawing.Brush"/> class representing the fill brush</returns> public Brush MakeBrush( RectangleF rect, PointPair dataValue ) { // get a brush if ( this.IsVisible && ( !_color.IsEmpty || _brush != null ) ) { if ( rect.Height < 1.0F ) rect.Height = 1.0F; if ( rect.Width < 1.0F ) rect.Width = 1.0F; //Brush brush; if ( _type == FillType.Brush ) { return ScaleBrush( rect, _brush, _isScaled ); } else if ( IsGradientValueType ) { if ( dataValue != null ) { if ( !_secondaryValueGradientColor.IsEmpty ) { // Go ahead and create a new Fill so we can do all the scaling, etc., // that is associated with a gradient Fill tmpFill = new Fill( _secondaryValueGradientColor, GetGradientColor( dataValue ), _angle ); return tmpFill.MakeBrush( rect ); } else return new SolidBrush( GetGradientColor( dataValue ) ); } else if ( _rangeDefault != double.MaxValue ) { if ( !_secondaryValueGradientColor.IsEmpty ) { // Go ahead and create a new Fill so we can do all the scaling, etc., // that is associated with a gradient Fill tmpFill = new Fill( _secondaryValueGradientColor, GetGradientColor( _rangeDefault ), _angle ); return tmpFill.MakeBrush( rect ); } else return new SolidBrush( GetGradientColor( _rangeDefault ) ); } else return ScaleBrush( rect, _brush, true ); } else return new SolidBrush( _color ); } // Always return a suitable default return new SolidBrush( Color.White ); }
/// <summary> /// The Copy Constructor /// </summary> /// <param name="rhs">The FontSpec object from which to copy</param> public FontSpec( FontSpec rhs ) { _fontColor = rhs.FontColor; _family = rhs.Family; _isBold = rhs.IsBold; _isItalic = rhs.IsItalic; _isUnderline = rhs.IsUnderline; _fill = rhs.Fill.Clone(); _border = rhs.Border.Clone(); _isAntiAlias = rhs._isAntiAlias; _stringAlignment = rhs.StringAlignment; _angle = rhs.Angle; _size = rhs.Size; _isDropShadow = rhs._isDropShadow; _dropShadowColor = rhs._dropShadowColor; _dropShadowAngle = rhs._dropShadowAngle; _dropShadowOffset = rhs._dropShadowOffset; _scaledSize = rhs._scaledSize; Remake( 1.0F, _size, ref _scaledSize, ref _font ); }
/// <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) ); }
/// <summary> /// Calculate the values needed to properly display this <see cref="GasGaugeRegion"/>. /// </summary> /// <param name="pane"> /// A graphic device object to be drawn into. This is normally e.Graphics from the /// PaintEventArgs argument to the Paint() method. /// </param> public static void CalculateGasGuageParameters( GraphPane pane ) { //loop thru slices and get total value and maxDisplacement double minVal = double.MaxValue; double maxVal = double.MinValue; foreach ( CurveItem curve in pane.CurveList ) if ( curve is GasGaugeRegion ) { GasGaugeRegion ggr = (GasGaugeRegion)curve; if ( maxVal < ggr.MaxValue ) maxVal = ggr.MaxValue; if ( minVal > ggr.MinValue ) minVal = ggr.MinValue; } //Calculate start and sweep angles for each of the GasGaugeRegion based on teh min and max value foreach ( CurveItem curve in pane.CurveList ) { if ( curve is GasGaugeRegion ) { GasGaugeRegion ggr = (GasGaugeRegion)curve; float start = ( (float)ggr.MinValue - (float)minVal ) / ( (float)maxVal - (float)minVal ) * 180.0f; float sweep = ( (float)ggr.MaxValue - (float)minVal ) / ( (float)maxVal - (float)minVal ) * 180.0f; sweep = sweep - start; Fill f = new Fill( Color.White, ggr.RegionColor, -( sweep / 2f ) ); ggr.Fill = f; ggr.StartAngle = start; ggr.SweepAngle = sweep; } } }
/// <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 LineBase( 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( "schema0" ); _width = info.GetSingle( "width" ); _style = (DashStyle)info.GetValue( "style", typeof( DashStyle ) ); _dashOn = info.GetSingle( "dashOn" ); _dashOff = info.GetSingle( "dashOff" ); _isVisible = info.GetBoolean( "isVisible" ); _isAntiAlias = info.GetBoolean( "isAntiAlias" ); _color = (Color)info.GetValue( "color", typeof( Color ) ); _gradientFill = (Fill)info.GetValue( "gradientFill", typeof( Fill ) ); }
/// <summary> /// Default constructor that sets the <see cref="SymbolType"/> and /// <see cref="Color"/> as specified, and the remaining /// <see cref="Symbol"/> properties to default /// values as defined in the <see cref="Default"/> class. /// </summary> /// <param name="type">A <see cref="SymbolType"/> enum value /// indicating the shape of the symbol</param> /// <param name="color">A <see cref="Color"/> value indicating /// the color of the symbol /// </param> public Symbol( SymbolType type, Color color ) { _size = Default.Size; _type = type; _isAntiAlias = Default.IsAntiAlias; _isVisible = Default.IsVisible; _border = new Border( Default.IsBorderVisible, color, Default.PenWidth ); _fill = new Fill( color, Default.FillBrush, Default.FillType ); _userSymbol = null; }
/// <summary> /// Constructor that sets the color property to the specified value, and sets /// the remaining <see cref="LineBase"/> properties to default /// values as defined in the <see cref="Default"/> class. /// </summary> /// <param name="color">The color to assign to this new Line object</param> public LineBase( Color color ) { _width = Default.Width; _style = Default.Style; _dashOn = Default.DashOn; _dashOff = Default.DashOff; _isVisible = Default.IsVisible; _color = color.IsEmpty ? Default.Color : color; _isAntiAlias = Default.IsAntiAlias; _gradientFill = new Fill( Color.Red, Color.White ); _gradientFill.Type = FillType.None; }
/// <summary> /// The Copy Constructor /// </summary> /// <param name="rhs">The LineBase object from which to copy</param> public LineBase( LineBase rhs ) { _width = rhs._width; _style = rhs._style; _dashOn = rhs._dashOn; _dashOff = rhs._dashOff; _isVisible = rhs._isVisible; _color = rhs._color; _isAntiAlias = rhs._isAntiAlias; _gradientFill = new Fill( rhs._gradientFill ); }
/// <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 Legend( 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" ); _position = (LegendPos)info.GetValue( "position", typeof( LegendPos ) ); _isHStack = info.GetBoolean( "isHStack" ); _isVisible = info.GetBoolean( "isVisible" ); _fill = (Fill)info.GetValue( "fill", typeof( Fill ) ); _border = (Border)info.GetValue( "border", typeof( Border ) ); _fontSpec = (FontSpec)info.GetValue( "fontSpec", typeof( FontSpec ) ); _location = (Location)info.GetValue( "location", typeof( Location ) ); _gap = info.GetSingle( "gap" ); if ( schema >= 11 ) _isReverse = info.GetBoolean( "isReverse" ); if ( schema >= 12 ) _isShowLegendSymbols = info.GetBoolean( "isShowLegendSymbols" ); }
/// <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; }
/// <summary> /// Default constructor that sets all <see cref="Legend"/> properties to default /// values as defined in the <see cref="Default"/> class. /// </summary> public Legend() { _position = Default.Position; _isHStack = Default.IsHStack; _isVisible = Default.IsVisible; this.Location = new Location( 0, 0, CoordType.PaneFraction ); _fontSpec = new FontSpec( Default.FontFamily, Default.FontSize, Default.FontColor, Default.FontBold, Default.FontItalic, Default.FontUnderline, Default.FontFillColor, Default.FontFillBrush, Default.FontFillType ); _fontSpec.Border.IsVisible = false; _border = new Border( Default.IsBorderVisible, Default.BorderColor, Default.BorderWidth ); _fill = new Fill( Default.FillColor, Default.FillBrush, Default.FillType ); _gap = Default.Gap; _isReverse = Default.IsReverse; _isShowLegendSymbols = Default.IsShowLegendSymbols; }
/// <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; }
/// <summary> /// The Copy Constructor /// </summary> /// <param name="rhs">The Symbol object from which to copy</param> public Symbol( Symbol rhs ) { _size = rhs.Size; _type = rhs.Type; _isAntiAlias = rhs._isAntiAlias; _isVisible = rhs.IsVisible; _fill = rhs.Fill.Clone(); _border = rhs.Border.Clone(); if ( rhs.UserSymbol != null ) _userSymbol = rhs.UserSymbol.Clone() as GraphicsPath; else _userSymbol = null; }
/// <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; }
/// <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 Symbol( 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" ); _size = info.GetSingle( "size" ); _type = (SymbolType) info.GetValue( "type", typeof(SymbolType) ); _isAntiAlias = info.GetBoolean( "isAntiAlias" ); _isVisible = info.GetBoolean( "isVisible" ); _fill = (Fill) info.GetValue( "fill", typeof(Fill) ); _border = (Border) info.GetValue( "border", typeof(Border) ); if ( sch >= 11 ) _userSymbol = (GraphicsPath)info.GetValue( "userSymbol", typeof( GraphicsPath ) ); else _userSymbol = null; }
/// <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 GasGaugeRegion( SerializationInfo info, StreamingContext context ) : base(info, 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( "schema2" ); _labelDetail = (TextObj)info.GetValue( "labelDetail", typeof( TextObj ) ); _fill = (Fill)info.GetValue( "fill", typeof( Fill ) ); _border = (Border)info.GetValue( "border", typeof( Border ) ); _color = (Color)info.GetValue( "color", typeof( Color ) ); _minValue = info.GetDouble( "minValue" ); _maxValue = info.GetDouble( "maxValue" ); _startAngle = (float)info.GetDouble( "startAngle" ); _sweepAngle = (float)info.GetDouble( "sweepAngle" ); _boundingRectangle = (RectangleF)info.GetValue( "boundingRectangle", typeof( RectangleF ) ); _slicePath = (GraphicsPath)info.GetValue( "slicePath", typeof( GraphicsPath ) ); }
/// <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 Chart( 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 ) ); _fill = (Fill)info.GetValue( "fill", typeof( Fill ) ); _border = (Border)info.GetValue( "border", typeof( Border ) ); _isRectAuto = info.GetBoolean( "isRectAuto" ); }
/// <summary> /// The Copy Constructor /// </summary> /// <param name="rhs">The Fill object from which to copy</param> public Fill( Fill rhs ) { _color = rhs._color; _secondaryValueGradientColor = rhs._color; if ( rhs._brush != null ) _brush = (Brush) rhs._brush.Clone(); else _brush = null; _type = rhs._type; _alignH = rhs.AlignH; _alignV = rhs.AlignV; _isScaled = rhs.IsScaled; _rangeMin = rhs._rangeMin; _rangeMax = rhs._rangeMax; _rangeDefault = rhs._rangeDefault; _gradientBM = null; if ( rhs._colorList != null ) _colorList = (Color[]) rhs._colorList.Clone(); else _colorList = null; if ( rhs._positionList != null ) { _positionList = (float[]) rhs._positionList.Clone(); } else _positionList = null; if ( rhs._image != null ) _image = (Image) rhs._image.Clone(); else _image = null; _angle = rhs._angle; _wrapMode = rhs._wrapMode; }
/// <summary> /// Default constructor. /// </summary> public Chart() { _isRectAuto = true; _border = new Border( Default.IsBorderVisible, Default.BorderColor, Default.BorderPenWidth ); _fill = new Fill( Default.FillColor, Default.FillBrush, Default.FillType ); }
private void Init( string family, float size, Color color, bool isBold, bool isItalic, bool isUnderline, Color fillColor, Brush fillBrush, FillType fillType ) { _fontColor = color; _family = family; _isBold = isBold; _isItalic = isItalic; _isUnderline = isUnderline; _size = size; _angle = 0F; _isAntiAlias = Default.IsAntiAlias; _stringAlignment = Default.StringAlignment; _isDropShadow = Default.IsDropShadow; _dropShadowColor = Default.DropShadowColor; _dropShadowAngle = Default.DropShadowAngle; _dropShadowOffset = Default.DropShadowOffset; _fill = new Fill( fillColor, fillBrush, fillType ); _border = new Border( true, Color.Black, 1.0F ); _scaledSize = -1; Remake( 1.0F, _size, ref _scaledSize, ref _font ); }
/// <summary> /// Copy constructor /// </summary> /// <param name="rhs">The source <see cref="Chart" /> to be copied.</param> public Chart( Chart rhs ) { _border = rhs._border.Clone(); _fill = rhs._fill.Clone(); _rect = rhs._rect; _isRectAuto = rhs._isRectAuto; }
/// <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 FontSpec( 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" ); _fontColor = (Color)info.GetValue( "fontColor", typeof( Color ) ); _family = info.GetString( "family" ); _isBold = info.GetBoolean( "isBold" ); _isItalic = info.GetBoolean( "isItalic" ); _isUnderline = info.GetBoolean( "isUnderline" ); _isAntiAlias = info.GetBoolean( "isAntiAlias" ); _fill = (Fill)info.GetValue( "fill", typeof( Fill ) ); _border = (Border)info.GetValue( "border", typeof( Border ) ); _angle = info.GetSingle( "angle" ); _stringAlignment = (StringAlignment)info.GetValue( "stringAlignment", typeof( StringAlignment ) ); _size = info.GetSingle( "size" ); _isDropShadow = info.GetBoolean( "isDropShadow" ); _dropShadowColor = (Color)info.GetValue( "dropShadowColor", typeof( Color ) ); _dropShadowAngle = info.GetSingle( "dropShadowAngle" ); _dropShadowOffset = info.GetSingle( "dropShadowOffset" ); _scaledSize = -1; Remake( 1.0F, _size, ref _scaledSize, ref _font ); }
/// <summary> /// The Copy Constructor /// </summary> /// <param name="rhs">The Bar object from which to copy</param> public Bar( Bar rhs ) { _border = (Border) rhs.Border.Clone(); _fill = (Fill) rhs.Fill.Clone(); }
/// <summary> /// Constructor that sets the color property to the specified value, and sets /// the remaining <see cref="Line"/> properties to default /// values as defined in the <see cref="Default"/> class. /// </summary> /// <param name="color">The color to assign to this new Line object</param> public Line( Color color ) { _color = color.IsEmpty ? Default.Color : color; _stepType = Default.StepType; _isSmooth = Default.IsSmooth; _smoothTension = Default.SmoothTension; _fill = new Fill( Default.FillColor, Default.FillBrush, Default.FillType ); _isOptimizedDraw = Default.IsOptimizedDraw; }
/// <summary> /// Default constructor that sets the /// <see cref="Color"/> as specified, and the remaining /// <see cref="Bar"/> properties to default /// values as defined in the <see cref="Default"/> class. /// The specified color is only applied to the /// <see cref="ZedGraph.Fill.Color"/>, and the <see cref="ZedGraph.LineBase.Color"/> /// will be defaulted. /// </summary> /// <param name="color">A <see cref="Color"/> value indicating /// the <see cref="ZedGraph.Fill.Color"/> /// of the Bar. /// </param> public Bar( Color color ) { _border = new Border( Default.IsBorderVisible, Default.BorderColor, Default.BorderWidth ); _fill = new Fill( color.IsEmpty ? Default.FillColor : color, Default.FillBrush, Default.FillType ); }
/// <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 Line( SerializationInfo info, StreamingContext context ) : base(info, 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" ); //if ( sch >= 14 ) // _color = (Color) info.GetValue( "color", typeof( Color ) ); _stepType = (StepType)info.GetValue( "stepType", typeof( StepType ) ); _isSmooth = info.GetBoolean( "isSmooth" ); _smoothTension = info.GetSingle( "smoothTension" ); _fill = (Fill)info.GetValue( "fill", typeof( Fill ) ); if ( sch >= 13 ) _isOptimizedDraw = info.GetBoolean( "isOptimizedDraw" ); }
/// <summary> /// The Copy Constructor /// </summary> /// <param name="rhs">The <see cref="PieItem"/> object from which to copy</param> public PieItem( PieItem rhs ) : base(rhs) { _pieValue = rhs._pieValue; _fill = rhs._fill.Clone(); this.Border = rhs._border.Clone(); _displacement = rhs._displacement; _labelDetail = rhs._labelDetail.Clone(); _labelType = rhs._labelType; _valueDecimalDigits = rhs._valueDecimalDigits; _percentDecimalDigits = rhs._percentDecimalDigits; }