Пример #1
0
        private void UndoLastActionClick(object sender, System.EventArgs e)
        {
//            button2.Enabled = false;  //have to disable button if calling this
//            foreach (DoesSomething thing in _allDoesSomethings)
//            {
//                counter = counter + 1;
//                if (counter == _allDoesSomethings.Count)
//                {
//
//                    thing.DoIt();
//                    _allDoesSomethings.RemoveAt(counter - 1);
//                    counter = 0;
//                    break;
//                }
//               // else
//               // {
//
//               // }
//
//            }
            int lastIndex = _allDoesSomethings.Count - 1;

            if (lastIndex >= 0)
            {
                DoesSomething lastAction = _allDoesSomethings[lastIndex];
                lastAction.DoIt();
            }
            else
            {
                MessageBox.Show("No 'last action' to Do or Undo!");
            }
        }
Пример #2
0
        private void MakeNewDoesSomething(object sender, System.EventArgs e)
        {
            DoesSomething newDoesSomething = new DoesSomething(WhatToDo.Text);

            newDoesSomething.Show();
            _allDoesSomethings.Add(newDoesSomething);
        }
Пример #3
0
 private void MakeNewDoesSomething(object sender, System.EventArgs e)
 {
     if (WhatToDo.TextLength != 0)
     {
         DoesSomething newDoesSomething = new DoesSomething(WhatToDo.Text);
         newDoesSomething.Show();
         _allDoesSomethings.Add(newDoesSomething);
     }
 }
Пример #4
0
 private void MakeNewDoesSomething(object sender, System.EventArgs e)
 {
     if (WhatToDo.Text == "")
     {
         MessageBox.Show("You must enter an action in the text box before creating a new DoesSomething window.", "Note");
     }
     else
     {
         DoesSomething newDoesSomething = new DoesSomething(WhatToDo.Text);
         newDoesSomething.Show();
         _allDoesSomethings.Add(newDoesSomething);
     }
 }
Пример #5
0
 private void MakeNewDoesSomething(object sender, System.EventArgs e)
 {
     if (WhatToDo.Text.Equals(""))
     {
         MessageBox.Show("Please enter a valid value in the entry field.");
     }
     else
     {
         DoesSomething newDoesSomething = new DoesSomething(WhatToDo.Text);
         newDoesSomething.Show();
         _allDoesSomethings.Add(newDoesSomething);
     }
 }
Пример #6
0
 private void MakeNewDoesSomething(object sender, System.EventArgs e)
 {
     if (WhatToDo.Text.Equals(""))
     {
         MessageBox.Show("Please enter a valid value in the entry field.");
     }
     else
     {
         DoesSomething newDoesSomething = new DoesSomething(WhatToDo.Text);
         newDoesSomething.Show();
         _allDoesSomethings.Add(newDoesSomething);
     }
 }
Пример #7
0
 private void MakeNewDoesSomething(object sender, System.EventArgs e)
 {
     if (WhatToDo.Text == "")
     {
         MessageBox.Show("You must enter an action in the text box before creating a new DoesSomething window.", "Note");
     }
     else
     {
         DoesSomething newDoesSomething = new DoesSomething(WhatToDo.Text);
         newDoesSomething.Show();
         _allDoesSomethings.Add(newDoesSomething);
     }
 }
Пример #8
0
        private void UndoLastAction(object sender, System.EventArgs e)
        {
            DoesSomething lastAction = _allDoesSomethings[_allDoesSomethings.Count - 1];

            lastAction.DoIt();
        }
Пример #9
0
 public void MakeNewDoesSomething(object sender, System.EventArgs e)
 {
     DoesSomething newDoesSomething = new DoesSomething(WhatToDo.Text);
     newDoesSomething.Show();
     _allDoesSomethings.Add(newDoesSomething);
 }