Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ZeroitMetroPieChart" /> class.
        /// </summary>
        public ZeroitMetroPieChart()
        {
            this._radius                 = 200;
            this._EffectSize             = 10;
            this._ShowEffect             = true;
            this._drawsegmentborders     = false;
            this._UseDynamicBorderColors = false;
            this._SegmentBorderSize      = 2;
            this._Style                = ZeroitMetroPieChart.TrackerStyle.Normal;
            this._ShowSegmentNames     = false;
            this._SegmentNamesPerRow   = 2;
            this._UseDynamicFillColors = false;
            this._FillColorAlpha       = 82;
            this._showDonutEffect      = false;
            this._DonutEffectSize      = 100;
            this._SeperateSegments     = false;
            this._DrawBorder           = false;
            this._BorderColor          = Color.FromArgb(18, 173, 196);
            this._BorderSize           = 2;
            this.Size = new System.Drawing.Size(215, 280);
            this.SetStyle(ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);
            this.UpdateStyles();
            ZeroitMetroPieChart metroPieChart = this;

            this._Segments.ItemAdded += new EventHandler <ZeroitMetroPieChartSegmentCollectionEventArgs>(metroPieChart.Paths_Added);
            ZeroitMetroPieChart metroPieChart1 = this;

            this._Segments.ItemRemoving += new EventHandler <ZeroitMetroPieChartSegmentCollectionEventArgs>(metroPieChart1.Paths_Removing);
        }
Example #2
0
 /// <summary>
 /// Handles the Removing event of the Paths control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="ZeroitMetroPieChartSegmentCollectionEventArgs"/> instance containing the event data.</param>
 private void Paths_Removing(object sender, ZeroitMetroPieChartSegmentCollectionEventArgs e)
 {
     if (e.Item != null)
     {
         ZeroitMetroPieChart metroPieChart = this;
         e.Item.PropertyChanged -= new PropertyChangedEventHandler(metroPieChart.Path_PropertyChanged);
     }
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="ZeroitMetroPieChartSmartTagActionList"/> class.
        /// </summary>
        /// <param name="component">A component related to the <see cref="T:System.ComponentModel.Design.DesignerActionList" />.</param>
        public ZeroitMetroPieChartSmartTagActionList(IComponent component) : base(component)
        {
            this.colUserControl = component as ZeroitMetroPieChart;

            // Cache a reference to DesignerActionUIService, so the
            // DesigneractionList can be refreshed.
            this.designerActionUISvc = GetService(typeof(DesignerActionUIService)) as DesignerActionUIService;
        }
Example #4
0
 /// <summary>
 /// Handles the Added event of the Paths control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="ZeroitMetroPieChartSegmentCollectionEventArgs"/> instance containing the event data.</param>
 private void Paths_Added(object sender, ZeroitMetroPieChartSegmentCollectionEventArgs e)
 {
     if (e.Item != null)
     {
         ZeroitMetroPieChart metroPieChart = this;
         e.Item.PropertyChanged += new PropertyChangedEventHandler(metroPieChart.Path_PropertyChanged);
     }
     ZeroitMetroPieChart.SegmentAddedEventHandler segmentAddedEventHandler = ZeroitMetroPieChart.SegmentAdded;
     if (segmentAddedEventHandler != null)
     {
         segmentAddedEventHandler(this, new ZeroitMetroPieChartSegmentCollectionEventArgs(e.Item));
     }
     this.Invalidate();
 }
Example #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MetroPieChartActionList"/> class.
 /// </summary>
 /// <param name="component">A component related to the <see cref="T:System.ComponentModel.Design.DesignerActionList" />.</param>
 public MetroPieChartActionList(IComponent component) : base(component)
 {
     this.designerActionSvc = null;
     this._pc = (ZeroitMetroPieChart)component;
     this.designerActionSvc = (DesignerActionUIService)this.GetService(typeof(DesignerActionUIService));
 }