예제 #1
0
        /// <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");
        }
예제 #2
0
 /// <summary>
 /// The Copy Constructor
 /// </summary>
 /// <param name="rhs">The <see cref="PieItem"/> object from which to copy</param>
 public PieItem(PieItem rhs) : base(rhs)
 {
     this.pieValue             = rhs.pieValue;
     this.fill                 = (Fill)rhs.fill.Clone();
     this.Border               = (Border)rhs.border.Clone();
     this.displacement         = rhs.displacement;
     this.labelDetail          = (TextItem)rhs.labelDetail.Clone();
     this.labelType            = rhs.labelType;
     this.valueDecimalDigits   = rhs.valueDecimalDigits;
     this.percentDecimalDigits = rhs.percentDecimalDigits;
 }
예제 #3
0
 /// <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;
 }
예제 #4
0
 /// <summary>
 /// Create a  new <see cref="PieItem"/>.
 /// </summary>
 /// <param name="pieValue">The value associated with this <see cref="PieItem"/> instance.</param>
 /// <param name="label">Text label for this <see cref="PieItem"/> instance</param>
 public PieItem(double pieValue, string label) : base(label)
 {
     this.pieValue     = pieValue;
     this.fill         = new Fill(rotator.NextColor);
     this.border       = new Border(Default.BorderColor, Default.BorderWidth);
     this.displacement = Default.Displacement;
     this.labelDetail  = new TextItem();
     this.labelDetail.FontSpec.Size = Default.FontSize;
     this.labelType            = Default.LabelType;
     this.valueDecimalDigits   = Default.ValueDecimalDigits;
     this.percentDecimalDigits = Default.PercentDecimalDigits;
 }
예제 #5
0
 /// <summary>
 /// Create a new <see cref="PieItem"/>.
 /// </summary>
 /// <param name="pieValue">The value associated with this <see cref="PieItem"/> instance.</param>
 /// <param name="color">The display color for this <see cref="PieItem"/> instance.</param>
 /// <param name="displacement">The amount this <see cref="PieItem"/>  instance will be
 /// displaced from the center point.</param>
 /// <param name="label">Text label for this <see cref="PieItem"/> instance.</param>
 public PieItem(double pieValue, Color color, double displacement, string label)
     : base(label)
 {
     _pieValue     = pieValue;
     _fill         = new Fill(color.IsEmpty ? _rotator.NextColor : color);
     _displacement = displacement;
     _border       = new Border(Default.BorderColor, Default.BorderWidth);
     _labelDetail  = new TextObj();
     _labelDetail.FontSpec.Size = Default.FontSize;
     _labelType            = Default.LabelType;
     _valueDecimalDigits   = Default.ValueDecimalDigits;
     _percentDecimalDigits = Default.PercentDecimalDigits;
     _slicePath            = null;
 }
예제 #6
0
        /// <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" );
        }
예제 #7
0
 /// <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;
 }
예제 #8
0
 /// <summary>
 /// Create a new <see cref="PieItem"/>.
 /// </summary>
 /// <param name="pieValue">The value associated with this <see cref="PieItem"/> instance.</param>
 /// <param name="color">The display color for this <see cref="PieItem"/> instance.</param>
 /// <param name="displacement">The amount this <see cref="PieItem"/>  instance will be 
 /// displaced from the center point.</param>
 /// <param name="label">Text label for this <see cref="PieItem"/> instance.</param>
 public PieItem( double pieValue, Color color, double displacement, string label )
     : base(label)
 {
     _pieValue = pieValue;
     _fill = new Fill( color.IsEmpty ? _rotator.NextColor : color );
     _displacement = displacement;
     _border = new Border( Default.BorderColor, Default.BorderWidth );
     _labelDetail = new TextObj();
     _labelDetail.FontSpec.Size = Default.FontSize;
     _labelType = Default.LabelType;
     _valueDecimalDigits = Default.ValueDecimalDigits;
     _percentDecimalDigits = Default.PercentDecimalDigits;
     _slicePath = null;
 }