示例#1
0
        private void ChangeTask()
        {
            if (Tasks_ListView.SelectedItems.Count != 1)
            {
                return;
            }

            SyncTask syncTask = Tasks_ListView.SelectedItem as SyncTask;

            if (syncTask == null)
            {
                return;
            }

            CreateTaskDialog dialog = new CreateTaskDialog(core, syncTask)
            {
                Title = "Изменение задачи"
            };

            if (dialog.ShowDialog() == true)
            {
                int i = Tasks_ListView.SelectedIndex;
                Settings.SyncTasks.RemoveAt(i);
                Settings.SyncTasks.Insert(i, dialog.SyncTask);
                Settings.SaveSyncTasks();
                Tasks_ListView.Items.Refresh();
            }
        }
示例#2
0
        private void CreateTask_Button_Click(object sender, RoutedEventArgs e)
        {
            CreateTaskDialog dialog = new CreateTaskDialog(core)
            {
                Title = "Создание задачи"
            };

            if (dialog.ShowDialog() == true)
            {
                Settings.SyncTasks.Add(dialog.SyncTask);
                Settings.SaveSyncTasks();
                Tasks_ListView.Items.Refresh();
            }
        }