Example #1
0
 public void ReturnToGenerator(Data data)
 {
     foreach (Form f in MdiChildren)
     {
         FrmGenerator gen = f as FrmGenerator;
         if (gen != null)
         {
             gen.CallMinMax(data);
             return;
         }
     }
 }
Example #2
0
 private FrmGenerator Exist()
 {
     foreach (Form f in MdiChildren)
     {
         FrmGenerator pom = f as FrmGenerator;
         if (pom != null)
         {
             return(pom);
         }
     }
     return(null);
 }
Example #3
0
        private void generatorFormToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmGenerator f = Exist();

            if (f == null)
            {
                FrmGenerator generator = new FrmGenerator();
                generator.MdiParent = this;
                gen = generator;
                generator.Show();
            }
            else
            {
                MessageBox.Show("You can't have two or more generators. Only one!");
            }
        }
Example #4
0
        private void chartVlaznostToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmChart     chartAH = null;
            FrmGenerator f       = Exist();

            if (f != null)
            {
                if (f.Checked())
                {
                    chartAH           = new FrmChart("Air H", "Ignorise opseg", false);
                    chartAH.MdiParent = this;
                }
                else
                {
                    chartAH           = new FrmChart("Air H", "Uzima samo pozitivne vrednosti", false);
                    chartAH.MdiParent = this;
                }
                chartAH.Show();
            }
            else
            {
                MessageBox.Show("Generator is off. Turn it on.");
            }
        }