public TaggingController(TaggingControl control, PomodoroEvaluationForm ownerForm)
        {
            this.control = control;
            this.pomodoroEvaluationForm = ownerForm;

            this.control.TextBoxControl.KeyPress += this.tagTextBox_KeyPress;
            this.control.TextBoxControl.Enter += this.tagTextBox_Enter;
            this.control.TextBoxControl.Leave += this.tagTextBox_Leave;
        }
Beispiel #2
0
        public TaggingController(TaggingControl control, PomodoroEvaluationForm ownerForm)
        {
            this.control = control;
            this.pomodoroEvaluationForm = ownerForm;

            this.control.TextBoxControl.KeyPress += this.tagTextBox_KeyPress;
            this.control.TextBoxControl.Enter    += this.tagTextBox_Enter;
            this.control.TextBoxControl.Leave    += this.tagTextBox_Leave;
        }
        public void SimpleTest()
        {
            var cs = new CherryService();

            //cs.PluginRepository.RegisterPlugin(new IconController());
            cs.PluginRepository.RegisterPlugin(new PomodoroSensor());

            var pe = new PomodoroEvaluationForm(cs.PluginRepository);

            pe.ShowDialog();
        }
        public void TieEvents(PluginRepository plugins)
        {
            this.showNoActivateCommand = plugins.CherryCommands["Show Window No Activate"];
            plugins.CherryEvents.Subscribe(new CherryEventListener(
                                               "Pomodoro Finished",
                                               ea =>
            {
                var pomodoro = (ea as PomodoroEventArgs).PomodoroData;
                if (pomodoro.Successful)
                {
                    this.pomodoroEvaluationForm.SetData(pomodoro);
                    this.showNoActivateCommand.Do(new WindowCommandArgs(this.pomodoroEvaluationForm));
                }
            }));

            this.pomodoroEvaluationForm = new PomodoroEvaluationForm(plugins);
        }
        public void TieEvents(PluginRepository plugins)
        {
            this.showNoActivateCommand = plugins.CherryCommands["Show Window No Activate"];
            plugins.CherryEvents.Subscribe(new CherryEventListener(
                "Pomodoro Finished",
                ea =>
                {
                    var pomodoro = (ea as PomodoroEventArgs).PomodoroData;
                    if (pomodoro.Successful)
                    {
                        this.pomodoroEvaluationForm.SetData(pomodoro);
                        this.showNoActivateCommand.Do(new WindowCommandArgs(this.pomodoroEvaluationForm));
                    }
                }));

            this.pomodoroEvaluationForm = new PomodoroEvaluationForm(plugins);
        }
        private void RunFakeEvaluation()
        {
            var mal = new List<int>();
            var kal = new List<int>();
            int max = 10;
            for (int i = 0; i < 6000; i++)
            {
                mal.Add((int)(i % max * Math.Abs(Math.Sin(i / 100)) * (i % 1000) * (i / 1000.0) / 10000.0));
                kal.Add((int)(i % max * Math.Abs(Math.Cos(i / 100)) * (i % 1000) * (i / 1000.0) / 10000.0));
            }

            CompletedPomodoro data = new CompletedPomodoro()
            {
                Start = DateTime.Now,
                Duration = TimeSpan.FromMinutes(25),
                MouseActivity = mal,
                KeyboardActivity = kal,
                TaskRegistrations = new List<TaskRegistration>()
                {
                    new TaskRegistration()
                    {
                        TaskName = "Task 0",
                        ProcessName = "Process 0",
                        TimeStamp = DateTime.Now,
                        Duration = TimeSpan.FromMinutes(1),
                    },
                    new TaskRegistration()
                    {
                        TaskName = "Task 1",
                        ProcessName = "Process 1",
                        TimeStamp = DateTime.Now + TimeSpan.FromMinutes(1),
                        Duration = TimeSpan.FromMinutes(9),
                    },
                    new TaskRegistration()
                    {
                        TaskName = "Task 2",
                        ProcessName = "Process 1",
                        TimeStamp = DateTime.Now + TimeSpan.FromMinutes(10),
                        Duration = TimeSpan.FromMinutes(5),
                    },
                    new TaskRegistration()
                    {
                        TaskName = "Task 3",
                        ProcessName = "Process 2",
                        TimeStamp = DateTime.Now + TimeSpan.FromMinutes(15),
                        Duration = TimeSpan.FromMinutes(5),
                    },
                    new TaskRegistration()
                    {
                        TaskName = "Task 4",
                        ProcessName = "Process 2",
                        TimeStamp = DateTime.Now + TimeSpan.FromMinutes(20),
                        Duration = TimeSpan.FromMinutes(5),
                    },
                }
            };

            var form = new PomodoroEvaluationForm(this.plugins);
            form.SetData(data);

            this.plugins.CherryCommands["Show Window No Activate"].Do(new WindowCommandArgs(form));
        }