コード例 #1
0
        private void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            e.Cancel = true;

            MessageBoxDialog messageDialog = new MessageBoxDialog();
            ConfigurationActionViewModel configurationActionViewModel = ((MainWindowViewModel)this.DataContext).ConfigurationActionViewDataContext;
            if (null != configurationActionViewModel.SelectedActionViewModel)
            {
                SettingsViewModelBase selectedActionViewModel = configurationActionViewModel.SelectedActionViewModel;
                if (true == selectedActionViewModel.IsChanged)
                {
                    messageDialog.Show(QuitApplication, "Warning", String.Format("The action {0} are not saved. Do you want to quit application?", selectedActionViewModel.Action.Name), MessageBoxButton.YesNo);
                    return;
                }
            }

            messageDialog.Show(QuitApplication, "Quit application?", "Do you want to quit application?", MessageBoxButton.YesNo);
        }
コード例 #2
0
        private void CreateCopyAction()
        {
            bool isComplete = CheckCompletedActionViewModel(m_SelectedActionViewModel);
            if (true == isComplete)
            {
                ConfirmActionNameViewModel confirmActionNameVM = new ConfirmActionNameViewModel(m_ActionViewModels);
                ConfirmActionNameWindow confirmActionNameWindow = new ConfirmActionNameWindow();
                confirmActionNameWindow.DataContext = confirmActionNameVM;

                if (true == confirmActionNameWindow.ShowDialog())
                {
                    string defaultActionName = confirmActionNameVM.ActionName;

                    CopyActionModel action = new CopyActionModel();
                    action.Name = defaultActionName;
                    action.Sources = new List<DragDropData>();
                    action.Destinations = new List<DragDropData>();

                    CopyActionViewModel actionVM = new CopyActionViewModel(action);
                    ActionViewModels.Add(actionVM);

                    SelectedViewModelsIndex(m_ActionViewModels.Count - 1);
                }
            }
            else
            {
                MessageBoxDialog messageDialog = new MessageBoxDialog();
                messageDialog.Show(CanExecuteActionCallback, "Information", String.Format("Cannot create new action now. The action {0} must be completed or saved first.", m_SelectedActionViewModel.Action.Name),
                                   MessageBoxButton.OK);
            }
        }
コード例 #3
0
 private void SaveChangedProcess(SettingsViewModelBase viewModel)
 {
     MessageBoxDialog messageDialog = new MessageBoxDialog();
     messageDialog.Show(SaveChangedCallback, "Confirm", String.Format("Do you want to save changed in {0}?", m_SelectedActionViewModel.Action.Name),
                        MessageBoxButton.YesNoCancel);
 }
コード例 #4
0
 private void CanExecuteActionProcess(SettingsViewModelBase viewModel)
 {
     MessageBoxDialog messageDialog = new MessageBoxDialog();
     messageDialog.Show(CanExecuteActionCallback, "Warning", String.Format("Sources or destinations of {0} cannot empty.", viewModel.Action.Name),
                        MessageBoxButton.OK);
 }