Exemplo n.º 1
0
        private void WorkWithTabControl_ChangeTabItemEvent()
        {
            WorksWithFlyouts.CloseAllFlyouts();
            WorksWithFlyouts.ClearBlackoutsDate();

            WorkWithFilters.Filters.OnOtherFilters();
        }
Exemplo n.º 2
0
        private void TreeView_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs <object> e)
        {
            WorksWithFlyouts.ClearBlackoutsDate();

            if (AddNewMission.IsOpen)
            {
                AddNewMission.IsOpen = false;
            }

            TreeView tr = (TreeView)sender;

            if (tr.SelectedItem == null)
            {
                return;
            }
            Mission SelectedMission = (Mission)tr.SelectedItem;

            //MessageBox.Show($"SelectedMission: {SelectedMission.Name} and {SelectedMission.ID}\n StartDate: {SelectedMission.StartDate.ToString()}\n FinishDate: {SelectedMission.FinishDate.ToString()}\n FatherId: {SelectedMission.FatherID}");
            if (SelectedMission.IsFinished)
            {
                return;
            }
            NeedToNotifySelectedItem.Instance.NeedToNotify = SelectedMission;
            EditingSelectedMission.IsOpen = true;
            NeedToNotifySelectedItem.Instance.UpdateBlackoutsDate();
        }
Exemplo n.º 3
0
 private void Add_Mission_Click(object sender, RoutedEventArgs e)
 {
     if (EditingSelectedMission.IsOpen)
     {
         EditingSelectedMission.IsOpen = false;
     }
     WorksWithFlyouts.ClearBlackoutsDate();
     NeedToNotifySelectedItem.Instance.NewTaskMarks.Clear();
     AddNewMission.IsOpen = true;
 }
Exemplo n.º 4
0
        private void DeleteMissionButton_Click(object sender, RoutedEventArgs e)
        {
            long id = (long)((Button)e.OriginalSource).Tag;

            WorksWithFlyouts.CloseAllFlyouts();
            WorksWithFlyouts.ClearBlackoutsDate();

            List <long> IdsToDelete = new List <long>();

            Methods.GetAllId(Methods.idToMission[id], ref IdsToDelete);

            Methods.idToMission[id].Remove();

            Methods.RemoveMissionFromDict(IdsToDelete);

            WorkWithTabControl.InstanceTabControl.OnTasksEmpty();

            WorkWithChart.AllConditions[0].CountCondition = WorkWithChart.GetCountActive(TreeViewModels.Root) - 1;
            WorkWithChart.AllConditions[1].CountCondition = WorkWithChart.GetCountInActive(TreeViewModels.Root);
        }