Exemple #1
0
 public override void OnOtherEvent(object sender, OtherEventType e)
 {
     if (e == OtherEventType.ResetZoom && !this.Equals(sender))
     {
         UpdateAxis(null, false, true);
     }
     if (e == OtherEventType.DataChanged)
     {
         UpdateAxis(null, false, false, true);
     }
 }
 private void ChartForm_OtherEvent(object sender, OtherEventType e)
 {
     if (e == OtherEventType.ResetZoom)
     {
         if (!((ChartForm)sender).IsEnable)
         {
             return;
         }
         foreach (ChartForm chartForm in tlbContent.Controls)
         {
             chartForm.OnOtherEvent(sender, e);
         }
     }
     if (e == OtherEventType.DataChanged)
     {
         if (sender != null && !((ChartForm)sender).IsEnable)
         {
             return;
         }
         Config.GlobalBorder = new ChartRect();
         foreach (ChartForm chartForm in tlbContent.Controls)
         {
             if (chartForm.IsEnable)
             {
                 Config.GlobalBorder.Union(chartForm.Border);
             }
         }
         foreach (ChartForm chartForm in tlbContent.Controls)
         {
             chartForm.OnOtherEvent(sender, e);
         }
     }
     if (e == OtherEventType.MinimizeChanged)
     {
         var senderCf = (ChartForm)sender;
         tlbContent.RowStyles[tlbContent.GetRow((Control)sender)] =
             senderCf.IsMinimize ?
             new RowStyle(SizeType.Absolute, senderCf.MinimumHeight) :
             new RowStyle(SizeType.Percent, 100F);
         UpdateScrollSize();
     }
     if (e == OtherEventType.CreateChart)
     {
         var form = new CreateForm
         {
             cmbType = { SelectedIndex = 0 },
             txtA    = { Text = (sender as ChartForm).ChartName }
         };
         foreach (ChartForm chartForm in tlbContent.Controls)
         {
             if (chartForm is FileForm && chartForm.IsEnable && !chartForm.Equals(sender))
             {
                 form.cmbB.Items.Add(new CmbItem(chartForm));
             }
         }
         if (form.ShowDialog() == DialogResult.OK)
         {
             if (form.cmbType.SelectedIndex == 0)
             {
                 var cnt = int.Parse(form.txtX.Text);
                 AddChart(new DistributionForm(sender as FileForm, cnt));
                 UpdateScrollSize();
             }
         }
     }
 }
 public virtual void OnOtherEvent(object sender, OtherEventType e)
 {
 }
 protected void OnOtherEvent(OtherEventType e)
 {
     OtherEvent?.Invoke(this, e);
 }