public void CreateChart(ZedGraph.ZedGraphControl zgc, ref CW_PeakRegs[] IR)
        {
            EventHandler method = null;

            try
            {
                zgc.GraphPane = this.myPane;
                zgc.GraphPane.CurveList.Clear();
                zgc.GraphPane.GraphObjList.Clear();
                this.RedLimit                = (double)this.RedNumericUpDown.Value;
                this.BlueLimit               = (double)this.BlueNumericUpDown.Value;
                this.GreenLimit              = (double)this.GreenNumericUpDown.Value;
                this.myPane.Title.Text       = "CW Interference Detection";
                this.myPane.YAxis.Title.Text = "Power dB/Hz";
                this.myPane.XAxis.Title.Text = "Frequency (from L1 center)";
                this.myPane.BarSettings.Type = ZedGraph.BarType.Overlay;
                int num  = 0;
                int num2 = 0;
                int num3 = 0;
                for (int i = 0; i < 8; i++)
                {
                    if (IR[i].magD >= this.GreenLimit)
                    {
                        if (IR[i].magD >= this.RedLimit)
                        {
                            num++;
                        }
                        if ((IR[i].magD >= this.BlueLimit) && (IR[i].magD < this.RedLimit))
                        {
                            num2++;
                        }
                        if (IR[i].magD < this.BlueLimit)
                        {
                            num3++;
                        }
                    }
                }
                double[] x         = new double[num];
                double[] y         = new double[num];
                double[] numArray3 = new double[num3];
                double[] numArray4 = new double[num3];
                double[] numArray5 = new double[num2];
                double[] numArray6 = new double[num2];
                int      index     = -1;
                int      num6      = -1;
                int      num7      = -1;
                for (int j = 0; j < 8; j++)
                {
                    try
                    {
                        if (IR[j].magD >= this.GreenLimit)
                        {
                            if ((num > 0) && (IR[j].magD >= this.RedLimit))
                            {
                                index++;
                                x[index] = IR[j].freqD;
                                y[index] = IR[j].magD;
                            }
                            if (((num2 > 0) && (IR[j].magD >= this.BlueLimit)) && (IR[j].magD < this.RedLimit))
                            {
                                num6++;
                                numArray5[num6] = IR[j].freqD;
                                numArray6[num6] = IR[j].magD;
                            }
                            if ((num3 > 0) && (IR[j].magD < this.BlueLimit))
                            {
                                num7++;
                                numArray3[num7] = IR[j].freqD;
                                numArray4[num7] = IR[j].magD;
                            }
                        }
                    }
                    catch (IndexOutOfRangeException exception)
                    {
                        string str = exception.ToString();
                        string msg = "### Interference Report GUI handler error -- " + str;
                        this.comm.WriteApp(msg);
                    }
                }
                if (num > 0)
                {
                    string label = string.Format(">{0:F1}", this.RedLimit);
                    this.myPane.AddBar(label, x, y, Color.Red);
                }
                if (num2 > 0)
                {
                    string str4 = string.Format(">{0:F1}", this.BlueLimit);
                    this.myPane.AddBar(str4, numArray5, numArray6, Color.Blue);
                }
                if (num3 > 0)
                {
                    string str5 = string.Format("<{0:F1}", this.GreenLimit);
                    this.myPane.AddBar(str5, numArray3, numArray4, Color.Green);
                }
                AddlabelToBars(this.myPane, x, y);
                AddlabelToBars(this.myPane, numArray5, numArray6);
                AddlabelToBars(this.myPane, numArray3, numArray4);
                this.myPane.Chart.Fill          = new ZedGraph.Fill(Color.White, Color.LightGoldenrodYellow, 45f);
                this.myPane.YAxis.Scale.MaxAuto = false;
                this.myPane.YAxis.Scale.MinAuto = false;
                this.myPane.XAxis.Scale.MaxAuto = false;
                this.myPane.XAxis.Scale.MinAuto = false;
                this.myPane.YAxis.Scale.Max     = 100.0;
                this.myPane.YAxis.Scale.Min     = 0.0;
                this.myPane.XAxis.Scale.Min     = 1.57E+15;
                this.myPane.XAxis.Scale.Max     = 1.58E+15;
                this.myPane.BarSettings.ClusterScaleWidthAuto = false;
                this.myPane.BarSettings.ClusterScaleWidth     = 1000000000000;
                zgc.AxisChange();
                this.myPane.Fill = new ZedGraph.Fill(Color.WhiteSmoke);
                if (method == null)
                {
                    method = delegate {
                        zgc.Refresh();
                        zgc.Update();
                    };
                }
                base.Invoke(method);
                zgc.Size = new Size(base.ClientRectangle.Width - 0x19, base.ClientRectangle.Height - 90);
            }
            catch (Exception exception2)
            {
                string str6 = exception2.ToString();
                string str7 = "### Interference Report GUI handler error -- " + str6;
                this.comm.WriteApp(str7);
            }
        }