Ejemplo n.º 1
0
        private void ListBoxSolutionsSelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
        {
            selectedSolution_ = e.AddedItems.Count == 1 ? e.AddedItems[0] as YsBuildRunner.Data.Solution : null;

            enablementManager_.ListState = Build.Solutions.Count == 0 ? ListState.Empty : ListState.NoEmpty;
            var selectedItemsCount = Build.Solutions.Where(p => p.IsSelected).Count();

            if (selectedItemsCount == 0)
            {
                enablementManager_.SelectionState = SelectionState.NoOneItemSelected;
            }
            else if (selectedItemsCount == 1)
            {
                enablementManager_.SelectionState = SelectionState.OneItemSelected;
            }
            else
            {
                enablementManager_.SelectionState = SelectionState.ManyItemsSelected;
            }

            if (selectedItemsCount > 0)
            {
                enablementManager_.FirstElementSelectionState = Build.Solutions[0].IsSelected ?
                                                                FirstElementSelectionState.Selected
                                        : FirstElementSelectionState.UnSelected;
                enablementManager_.LastElementSelectionState = Build.Solutions[Build.Solutions.Count - 1].IsSelected ?
                                                               LastElementSelectionState.Selected
                                        : LastElementSelectionState.UnSelected;
            }
        }
Ejemplo n.º 2
0
        private void OnBuildExecute(Data.Solution solution)
        {
            Build.Processed = Build.Processed + 1;

            window_.Dispatcher.Invoke(DispatcherPriority.Normal, new Action(() =>
            {
                selectedSolution_            = solution;
                selectedSolution_.IsSelected = true;
                window_.listBoxSolutions.ScrollIntoView(selectedSolution_);
            }));
        }
Ejemplo n.º 3
0
        private void OnBuildExecuted(string name)
        {
            // Select first solution.
            window_.Dispatcher.Invoke(DispatcherPriority.Normal, new Action(() =>
            {
                Build.Solutions[0].IsSelected = false;
                selectedSolution_             = Build.Solutions[0];

                window_.listBoxSolutions.ScrollIntoView(
                    selectedSolution_);

                enablementManager_.ExecutionState = ExecutionState.NoRunning;
            }));
        }