Ejemplo n.º 1
0
 private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
 {
     MainPanel.Controls.Clear();
     try
     {
         Control c = (Control)Activator.CreateInstance(UC[comboBox1.SelectedIndex]);
         c.Dock = DockStyle.Fill;
         if (singles.Contains(UC[comboBox1.SelectedIndex]))
         {
             MainPanel.Controls.Add(c);
             return;
         }
         c.Dock = DockStyle.Top;
         c.Size = new Size(c.Size.Width, MainPanel.Size.Height / 2);
         dynamic foo = Convert.ChangeType(c, UC[comboBox1.SelectedIndex]);
         try
         {
             foo.SetParent(this);
         }
         catch { }
         MainPanel.Controls.Add(foo);
         Control d = (Control)Activator.CreateInstance(UC2[comboBox2.SelectedIndex]);
         d.Dock = DockStyle.Bottom;
         d.Size = new System.Drawing.Size(c.Size.Width, MainPanel.Size.Height / 2);
         dynamic bar = Convert.ChangeType(d, UC2[comboBox2.SelectedIndex]);
         try
         {
             bar.SetParent(this);
         }
         catch { }
         selout = bar;
         MainPanel.Controls.Add(bar);
         return;
     }
     catch {
         Console.WriteLine("*hiccup*");
         Interpreters.BatchCSharp bcs= new Interpreters.BatchCSharp();
         bcs.Dock = DockStyle.Fill;
         MainPanel.Controls.Add(bcs);
     }
 }
Ejemplo n.º 2
0
 private void Form1_Load(object sender, EventArgs e)
 {
     /*
     batch1.SetParent(this); base1.SetParent(this); cSharp1.SetParent(this);
     /*/
     MainPanel.Controls.Clear();
     Interpreter.Interpreters.BatchCSharp bcs = new Interpreters.BatchCSharp();
     bcs.Dock = DockStyle.Fill;
     MainPanel.Controls.Add(bcs);
     //*/
 }