Exemple #1
0
        private void mnuNewTr_Click(object sender, EventArgs e)
        {
            InputBox.InputResult res = InputBox.Show("New Trigger", "Enter name:");

            if (res.ReturnCode == DialogResult.OK)
            {
                string      id = nextID();
                TriggerType tr = new TriggerType(id, res.Text, triggerTypeOptions);
                triggerTypes.Add(tr);
                olvTr.BeginUpdate();
                olvTr.AddObject(tr);
                olvTr.EndUpdate();
                olvTr.SelectedObject = tr;
                olvTr.EnsureVisible();
            }
        }
Exemple #2
0
        private void mnuNewST_Click(object sender, EventArgs e)
        {
            InputBox.InputResult res = InputBox.Show("New Script Type", "Enter name:");

            if (res.ReturnCode == DialogResult.OK)
            {
                string     id = nextID();
                ScriptType st = new ScriptType(id, res.Text);
                scriptTypes.Add(st);
                olvST.BeginUpdate();
                olvST.AddObject(st);
                olvST.EndUpdate();
                olvST.SelectedObject = st;
                olvST.EnsureVisible();
            }
        }
Exemple #3
0
        private void mnuNewTF_Click(object sender, EventArgs e)
        {
            InputBox.InputResult res = InputBox.Show("New Task Force", "Enter name:");

            if (res.ReturnCode == DialogResult.OK)
            {
                string    id = nextID();
                TaskForce tf = new TaskForce(id, res.Text, groupTypes[0]);
                taskForces.Add(tf);
                olvTF.BeginUpdate();
                olvTF.AddObject(tf);
                olvTF.EndUpdate();
                olvTF.SelectedObject = tf;
                olvTF.EnsureVisible();
            }
        }
Exemple #4
0
 public void CopyAIObject <T>(string title, T selected, AITable <T> aitable, BrightIdeasSoftware.ObjectListView olv)
     where T : class, IAIObject
 {
     if (selected == null)
     {
         return;
     }
     InputBox.InputResult res = InputBox.Show(title, "Enter name:", selected.Name);
     if (res.ReturnCode == DialogResult.OK)
     {
         T newai = selected.Copy(nextID(), res.Text) as T;
         aitable.Add(newai);
         olv.BeginUpdate();
         olv.AddObject(newai);
         olv.EndUpdate();
         olv.SelectedObject = newai;
         olv.EnsureVisible();
     }
 }
Exemple #5
0
        private void mnuTTNew_Click(object sender, EventArgs e)
        {
            InputBox.InputResult res = InputBox.Show("New Team", "Enter name:");

            if (res.ReturnCode == DialogResult.OK)
            {
                string id = nextID();
                List <TeamTypeEntry> entries = new List <TeamTypeEntry>();
                foreach (TeamTypeOption option in teamTypeOptions)
                {
                    entries.Add(option.DefaultValue);
                }
                TeamType tt = new TeamType(id, res.Text, entries);
                teamTypes.Add(tt);
                olvTT.BeginUpdate();
                olvTT.AddObject(tt);
                olvTT.EndUpdate();
                olvTT.SelectedObject = tt;
                olvTT.EnsureVisible();
            }
        }