コード例 #1
0
ファイル: NewCom.cs プロジェクト: devapromix-ifiction/DzQ
        void CB5SelectedIndexChanged(object sender, EventArgs e)
        {
            AddSmth addsmth = new AddSmth();

            if ((sender as ComboBox).Text == "New variable...")
            {
                addsmth.ShowDialog();
                if (addsmth.Input == "")
                {
                    return;
                }
                store.AddVar(addsmth.Input);
                VarEd vared = new VarEd(store.GetVar(addsmth.Input));
                vared.ShowDialog();
                (sender as ComboBox).Items.Add(addsmth.Input);
                (sender as ComboBox).Text = addsmth.Input;
            }
            if ((sender as ComboBox).Text == "New block...")
            {
                addsmth.ShowDialog();
                if (addsmth.Input == "")
                {
                    return;
                }
                store.AddGBlock(addsmth.Input);
                CmbEd cmbed = new CmbEd(store.GetGBlock(addsmth.Input), null, store);

                cmbed.ShowDialog();
                (sender as ComboBox).Items.Add(addsmth.Input);
                (sender as ComboBox).Text = addsmth.Input;
            }
            if ((sender as ComboBox).Text == "New location...")
            {
                addsmth.ShowDialog();
                if (addsmth.Input == "")
                {
                    return;
                }
                store.AddLoc(addsmth.Input);
                LocEd loced = new LocEd(store.GetLoc(addsmth.Input), store);

                loced.ShowDialog();
                (sender as ComboBox).Items.Add(addsmth.Input);
                (sender as ComboBox).Text = addsmth.Input;
            }
            if ((sender as ComboBox).Text == "New item...")
            {
                addsmth.ShowDialog();
                if (addsmth.Input == "")
                {
                    return;
                }
                store.AddItm(addsmth.Input);
                ItmEd itmed = new ItmEd(store.GetItm(addsmth.Input), store);

                itmed.ShowDialog();
                (sender as ComboBox).Items.Add(addsmth.Input);
                (sender as ComboBox).Text = addsmth.Input;
            }
        }
コード例 #2
0
 void Button1Click(object sender, EventArgs e)
 {
     addsmth.ShowDialog();
     if (addsmth.Input != "")
     {
         storage.AddLoc(addsmth.Input);
         LocEd loced = new LocEd(storage.GetLoc(addsmth.Input), storage);
         loced.ShowDialog();
     }
     storage.RefreshLocs(listBox1);
     RefreshAll();
 }
コード例 #3
0
        void Button5Click(object sender, EventArgs e)
        {
            LocEd loced;

            if (listBox1.SelectedIndex != -1)
            {
                loced = new LocEd(storage.GetLoc(listBox1.SelectedItem.ToString()), storage);
                loced.ShowDialog();
            }
            storage.RefreshLocs(listBox1);
            RefreshAll();
        }