Exemplo n.º 1
0
        private void ReminderForm_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            Core.SettingStore.WriteInt("Tasks", "ReminderInterval", _snoozePeriodList.SelectedIndex);

            _taskLive.Dispose();
            _reminderForm  = null;
            _switchingDone = false;
        }
Exemplo n.º 2
0
        private static void WorkspaceManager_WorkspaceChanged(object sender, EventArgs e)
        {
            IResource workspace = Core.WorkspaceManager.ActiveWorkspace;

            if (workspace != null)
            {
                IResourceList tasks = workspace.GetLinksOfType("Task", _propRemindWorkspace);
                foreach (IResource task in tasks)
                {
                    ReminderForm.AddTask(task);
                }
            }
            UpdateToDoCount();
        }
Exemplo n.º 3
0
        private void _openButton_Click(object sender, System.EventArgs e)
        {
            int       elements = _targetList.JetListView.Nodes.Count;
            IResource task     = GetActiveTask();

            if (task == null)
            {
                return;
            }

            OpenTaskAction.OpenTask(task);

            if (elements == 1)
            {
                Close();
                _reminderForm = null;
            }
        }
Exemplo n.º 4
0
        public static void  AddTask(IResource task)
        {
            try
            {
                if (_reminderForm == null)
                {
                    _reminderForm = new ReminderForm(task);
                    _reminderForm.Show();
                }
                else
                {
                    _reminderForm.Text = "Summary for " + (_reminderForm._taskLive.Count + 1).ToString() + " reminders";
                    _reminderForm._targetsLabel.Text        = "Reminders:";
                    _reminderForm._dismissAllButton.Visible = true;
                    _reminderForm._snoozeAllButton.Visible  = true;

                    _reminderForm.InitSpyResourceList(task);
                    _reminderForm.HideDescriptionBox();

                    //  Moment when we have to switch between modes...
                    if (!_switchingDone)
                    {
                        _switchingDone = true;
                        _reminderForm._targetList.JetListView.Nodes.Clear();
                        foreach (IResource res in _reminderForm._taskLive)
                        {
                            _reminderForm._targetList.JetListView.Nodes.Add(res);
                        }
                        _reminderForm._targetList.Selection.SelectSingleItem(task);
                    }
                }
            }
            catch (ResourceDeletedException)
            {
                // task could be deleted while we did smth in the UI thread
            }
        }