示例#1
0
        public ControlCenter(MainWindow mw)
        {
            this.mw = mw;
            tm = new TaskManager();
            api = new API(tm);
            eh = new CommandLineHanlder(api);

            //set up file manager
            fm = new FileManager(tm);
            fm.loadFile(FILEPATH);
            tm.TaskChangeEvent += new TaskManager.TaskChangeHandler(fm.write);

            //setting up all the events
            api.StatusChangeEvent += new API.StatusChangeHandler(mw.onStatusChange);
            api.ViewChangeEvent += new API.ViewChangeHandler(mw.onViewChange);

            // Set up key_event handler for windows components
            // handle the event 'a command is entered'
            mw.commandLine.KeyUp += new KeyEventHandler(eh.KeyUp);
            mw.commandLine.KeyDown += new KeyEventHandler(eh.KeyDown);
            mw.commandLine.MouseLeftButtonDown += new MouseButtonEventHandler(eh.MouseLeftButtonDown);
            mw.commandLine.LostFocus += new RoutedEventHandler(eh.LostFocus);
            mw.commandLine.Text = "Enter Command";
        }
示例#2
0
 public FileManager(TaskManager tm)
 {
     this.tm = tm;
 }
示例#3
0
文件: API.cs 项目: angad/ToDoOrNoToDo
 //View.OutputHandler oh = new View.OutputHandler();
 public API(TaskManager tmRef)
 {
     this.tm = tmRef;
 }