private void NewCMDButton_Click(object sender, RoutedEventArgs e)
 {
     activeTask = null;
     ConfigureFlyout(TaskType.BatchFile);
     EditFlyout.ShowAt(LayoutRoot, new FlyoutShowOptions()
     {
         Placement = FlyoutPlacementMode.Auto
     });
 }
 private void EditButton_Click(object sender, RoutedEventArgs e)
 {
     activeTask      = GetTaskFromButton(sender as Button);
     activeTaskIndex = TasksCollection.IndexOf(activeTask);
     ConfigureFlyout(activeTask.Type);
     EditFlyout.ShowAt(LayoutRoot, new FlyoutShowOptions()
     {
         Placement = FlyoutPlacementMode.Auto,
         ShowMode  = FlyoutShowMode.Standard
     });
 }
Beispiel #3
0
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            BackButton.IsEnabled = this.Frame.CanGoBack;

            if (e != null && e.Parameter != null)
            {
                isNewList = false;
                activeList = (TaskList)e.Parameter;
            }
            else
            {
                isNewList = true;
                var guid = Guid.NewGuid();
                activeList = new TaskList(guid.ToString(), guid);
            }

            try
            {
                AppComboBox.ItemsSource = await Client.GetInstalledApps();
            }
            catch (Exception)
            {
                // WDP might not be running, just dont put any apps in the list
                AppComboBox.ItemsSource = new List<string>();
            }

            ParallelCheck.IsChecked = activeList.RunInParallel;
            BlockingCheck.IsChecked = activeList.AllowOtherTaskListsToRun;
            TerminateBgTasksCheck.IsChecked = activeList.TerminateBackgroundTasksOnCompletion;
            UpdateHeader();

            TasksCollection = new ObservableCollection<TaskBase>(activeList.Tasks);
            TaskListView.ItemsSource = TasksCollection;

            BackgroundTasksCollection = new ObservableCollection<TaskBase>(activeList.BackgroundTasks);
            BgTaskListView.ItemsSource = BackgroundTasksCollection;

            if (BackgroundTasksCollection.Count > 0)
            {
                BgTasksHeader.Visibility = Visibility.Visible;
            }
            if (TasksCollection.Count > 0)
            {
                TasksHeader.Visibility = Visibility.Visible;
            }

            listEdited = false;


            var style = new Style(typeof(FlyoutPresenter));
            style.Setters.Add(new Setter(FlyoutPresenter.MinWidthProperty, Window.Current.CoreWindow.Bounds.Width));
            style.Setters.Add(new Setter(FlyoutPresenter.MinHeightProperty, Window.Current.CoreWindow.Bounds.Height));
            EditFlyout.SetValue(Flyout.FlyoutPresenterStyleProperty, style);
        }
        private void EditCancelBtn_Click(object sender, RoutedEventArgs e)
        {
            EditNameTb.Text   = latestName;
            EditDOBDpk.Date   = latestDOB;
            EditHeightTb.Text = latestHeight;
            EditWeightTb.Text = latestWeight;
            EditCurrentLocationRBtn.IsChecked = latestCurrentLocationR;
            EditOtherRBtn.IsChecked           = latestOtherR;
            EditOtherTb.Text = latestOther;
            EditTelTb.Text   = latestTel;

            EditFlyout.Hide();
        }
Beispiel #5
0
        private void EditEvent_Click(object sender, RoutedEventArgs e)
        {
            EditFlyout.Hide();
            int itemIndex = EventListView.SelectedIndex;

            Events editedEvent = EventsManager.loveEvents[itemIndex];

            EditedEvent.SetEditedEvent(editedEvent);

            SelectedFold.selectedFoldIndex = FoldIndexConstants.loveEvent;

            SelectedEventIndex.selectedItemIndex = itemIndex;
            OnNavigateParentReady(this, null);
        }
Beispiel #6
0
        private void EditEvent_Click(object sender, RoutedEventArgs e)
        {
            EditFlyout.Hide();
            int itemIndex = EventListView.SelectedIndex;

            Events editedEvent = EventsManager.GetSingleEventByIndex(foldIndex, itemIndex);

            EditedEvent.SetEditedEvent(editedEvent);

            SelectedFold.selectedFoldIndex = foldIndex;

            SelectedEventIndex.selectedItemIndex = itemIndex;

            OnNavigateParentReady(this, null);
        }
        private void EditConfirmBtn_Click(object sender, RoutedEventArgs e)
        {
            int age = DateTime.Now.Year - EditDOBDpk.Date.Year;

            if (EditDOBDpk.Date.AddYears(age) > DateTime.Now)
            {
                age--;
            }


            ShowNameTbl.Text   = EditNameTb.Text;
            ShowAgeTbl.Text    = age.ToString("G");
            ShowHeightTbl.Text = EditHeightTb.Text;
            ShowWeightTbl.Text = EditWeightTb.Text;
            ShowTelTbl.Text    = "Tel. " + EditTelTb.Text;

            EditFlyout.Hide();
        }
        private void ConfirmEdit_Click(object sender, RoutedEventArgs e)
        {
            activeTask = CreateTestFromFlyout(activeTaskType);

            if (activeTask != null)
            {
                if (activeTaskIsNowBg)
                {
                    if (activeTaskWasBg && activeTaskIndex >= 0)
                    {
                        BackgroundTasksCollection[activeTaskIndex] = activeTask;
                    }
                    else if (!activeTaskWasBg && activeTaskIndex >= 0)
                    {
                        BackgroundTasksCollection.Add(activeTask);
                        TasksCollection.RemoveAt(activeTaskIndex);
                    }
                    else
                    {
                        BackgroundTasksCollection.Add(activeTask);
                    }
                }
                else
                {
                    if (activeTaskWasBg && activeTaskIndex >= 0)
                    {
                        TasksCollection.Add(activeTask);
                        BackgroundTasksCollection.RemoveAt(activeTaskIndex);
                    }
                    else if (!activeTaskWasBg && activeTaskIndex >= 0)
                    {
                        TasksCollection[activeTaskIndex] = activeTask;
                    }
                    else
                    {
                        TasksCollection.Add(activeTask);
                    }
                }

                listEdited = true;
            }

            if (BackgroundTasksCollection.Count > 0)
            {
                BgTasksHeader.Visibility = Visibility.Visible;
            }
            else
            {
                BgTasksHeader.Visibility = Visibility.Collapsed;
            }
            if (TasksCollection.Count > 0)
            {
                TasksHeader.Visibility = Visibility.Visible;
            }
            else
            {
                TasksHeader.Visibility = Visibility.Collapsed;
            }

            EditFlyout.Hide();
        }
 private void CancelEdit_Click(object sender, RoutedEventArgs e)
 {
     activeTask      = null;
     activeTaskIndex = -1;
     EditFlyout.Hide();
 }