-
Notifications
You must be signed in to change notification settings - Fork 1
/
Command.cs
69 lines (58 loc) · 1.02 KB
/
Command.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
* Creato da SharpDevelop.
* Utente: michele
* Data: 06/02/2009
* Ora: 15.23
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.Collections;
namespace mkdb
{
public enum CommandFlags
{
TB_NONE = 0,
TB_CMD_SIZER
}
public abstract class Command
{
private string _cmd_name;
public Command() {}
public Command(string _name)
{
_cmd_name = _name;
}
public virtual bool Execute()
{
return true;
}
public virtual void Undo() {}
public virtual void Redo() {}
public string Name
{
get { return _cmd_name; }
set { _cmd_name = value; }
}
}
public class CommandManager
{
private ArrayList _cmd_list;
public CommandManager()
{
_cmd_list = new ArrayList();
}
public int AddCommand(Command cmd)
{
return _cmd_list.Add(cmd);
}
public void RemCommand(Command cmd)
{
_cmd_list.Remove(cmd);
}
public ArrayList CommandList
{
get { return _cmd_list; }
}
}
}