Exemplo n.º 1
0
 void TaskForm_MouseUp(object sender, MouseEventArgs e)
 {
     if (_isClick)
     {
         TaskEditForm form = new TaskEditForm(DailyTask);
         form.GlobalStyleManager = this.StyleManager;
         form.StartPosition      = FormStartPosition.CenterParent;
         if (form.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
         {
             ShowTaskContentItem(DailyTask);
             if (SaveEvent != null)
             {
                 this.SaveEvent(this, null);
             }
         }
     }
 }
Exemplo n.º 2
0
        private void addTab_Click(object sender, EventArgs e)
        {
            DailyTask dt = new DailyTask();

            using (TaskEditForm editForm = new TaskEditForm(dt))
            {
                editForm.GlobalStyleManager = this.metroStyleManager;
                if (editForm.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
                {
                    var group = this.metroTabControl.SelectedTab.Tag as ITaskGroup;
                    if (TaskManager.AddTask(group, dt))
                    {
                        var form = AddTaskForm(dt);
                        this.metroTabControl.SelectedTab.Controls.Add(form);
                        this.metroTabControl.SelectedTab.ScrollControlIntoView(form);
                        this.metroStyleManager.Update();
                    }
                }
            }
        }