Beispiel #1
0
        public void AddCommand(TextCommand c)
        {
            List <TextCommand> a = TextCommands.ToList();

            a.Add(c);
            TextCommands = a.ToArray();
        }
Beispiel #2
0
        public Boolean DeleteCommand(String Command)
        {
            int Index = -1;

            for (int i = 0; i < TextCommands.Length; i++)
            {
                if (TextCommands[i].Command == Command)
                {
                    Index = i;
                    break;
                }
            }
            if (Index < 0)
            {
                return(false);
            }

            List <TextCommand> t = TextCommands.ToList();

            t.RemoveAt(Index);
            TextCommands = t.ToArray();
            Console.WriteLine("Removed " + Index);
            return(true);
        }