public void Execute(ActionExecutionContext context = null)
        {
            Result = MessageBox.Show(_message, _caption, _button);

            if (Completed != null)
                Completed(this, new ResultCompletionEventArgs());
        }
        public Dial_confirmacion_AprobacionSeguroFunerario(Empresa.Docente.tsolicitudfunenario item)
        {
            InitializeComponent();
            this._solicitud = item;
            this.Resultado = MessageBoxResult.No;

            //Aplicando mensaje. 
            this.txb_mensaje.Text = "Desea Aprobar la siguiente solicitud con el MONTO DE: " + item.Monto.ToString() + " , Si/no?";
        }
示例#3
0
        public MessageBoxResponse ShowYesNoCancelMessage(string message)
        {
            System.Windows.MessageBoxResult msgResult = MessageBoxResult.None;
            if (ApplicationServices == null)
            {
                msgResult = MessageBox.Show(message, "Confirmation", MessageBoxButton.YesNoCancel);
            }
            else
            {
                ApplicationServices.ExecuteOnUIThread(() => msgResult = MessageBox.Show(message, "Confirmation", MessageBoxButton.YesNoCancel));
            }

            return(ConvertMessageBoxResult(msgResult));
        }
示例#4
0
        public static void CreateLocalDatabaseFile()
        {
            // Nějaké pozůstatky z předchozí instalace
            string path = (System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "PASS"));

            if (Directory.Exists(path))
            {
                System.Windows.MessageBoxResult result = MessageBox.Show("Na tomto počítači byla nalezena databáze předchozí instalace této aplikace - adresář: " + System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "PASS") + Environment.NewLine + "Pokračováním budou tato data ztracena. Volbou 'ne' budou všechna  data zachována.", "Varování", MessageBoxButton.YesNo, MessageBoxImage.Exclamation);
                if (result == MessageBoxResult.Yes)
                {
                    // Smazat všechen obsah složky PASS
                    DirectoryInfo dir = new DirectoryInfo(path);
                    dir.Delete(true);

                    //Vytvořit složku AppData
                    Directory.CreateDirectory(System.IO.Path.Combine(path, "AppData"));

                    // Vytvořit data v adresáři
                    System.IO.File.Copy("AppData/Database.mdf", System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "PASS", "AppData", "Database.mdf"));
                    System.IO.File.Copy("AppData/Database_log.ldf", System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "PASS", "AppData", "Database_log.ldf"));

                    try
                    {
                        DatabaseSetup.SetupDatabase();
                    }
                    catch (Exception ex)
                    {
                        // DialogHelper.ShowWarning("Nová databázová struktura nebyla vytvořena. Původní data zůstala nezměněna.");
                        DialogHelper.ShowError(ex.Message);
                    }
                }
            }
            else // Čistá instalace
            {
                Directory.CreateDirectory(System.IO.Path.Combine(path, "AppData")); // Vytvoří nadsložku PASS a podsložku AppData zároveň
                // Vytvořit data v adresáři
                System.IO.File.Copy("AppData/Database.mdf", System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "PASS", "AppData", "Database.mdf"));
                System.IO.File.Copy("AppData/Database_log.ldf", System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "PASS", "AppData", "Database_log.ldf"));

                try
                {
                    DatabaseSetup.SetupDatabase();
                }
                catch (Exception ex)
                {
                    // DialogHelper.ShowWarning("Nová databázová struktura nebyla vytvořena. Původní data zůstala nezměněna.");
                    DialogHelper.ShowError(ex.Message);
                }
            }
        }
示例#5
0
            public void Execute(ActionExecutionContext context)
            {
                System.Windows.MessageBoxResult result = MessageBox.Show(
                    "Are you sure you want to exit?",
                    "Confirm",
                    MessageBoxButton.YesNo,
                    MessageBoxImage.Warning,
                    System.Windows.MessageBoxResult.No);

                Completed(
                    this,
                    new ResultCompletionEventArgs {
                    WasCancelled = (result != System.Windows.MessageBoxResult.Yes)
                });
            }
        private void Export_Part_MegaMap(string path, int x, int y, int w, int h)
        {
            Scena scn = Gl.curr_scena;

            if (File.Exists(path))
            {
                System.Windows.MessageBoxResult res = System.Windows.MessageBox.Show("File \"" + path + "\" is exist. Replace it?", "Divide MEGA MAP", MessageBoxButton.YesNo, MessageBoxImage.Question);
                if (res == MessageBoxResult.No)
                {
                    return;
                }
            }

            scn.Save_Scene_Part(path, x, y, w, h);
        }
        private void ChangeLanguage()
        {
            System.Windows.MessageBoxResult result = System.Windows.MessageBox.Show("Would you like to change language?", "", MessageBoxButton.OK);
            if (result == MessageBoxResult.OK)
            {
                SetSetting("defaultlanguage", SelectedLanguage.Abbrevation);

                parentWindow.Close();
                Thread.Sleep(100);

                var folder = System.AppDomain.CurrentDomain.BaseDirectory;
                Process.Start(Path.Combine(folder, "PhotoUploader.exe"));
                return;
            }
        }
示例#8
0
        private void btn1_Click(object sender, RoutedEventArgs e)
        {
            System.Windows.MessageBoxResult result = MessageBox.Show("Voulez vous vraiment supprimer les fichiers tmp", "Suppresion fichier temp",
                                                                     MessageBoxButton.OKCancel, MessageBoxImage.Warning);
            if (result == MessageBoxResult.OK)
            {
                ScriptSup tmp = new ScriptSup();

                Thread workerThread = new Thread(tmp.invoke);
                workerThread.Start();
                //                tmp.invoke();
            }
            else
            {
            }
        }
示例#9
0
文件: mainForm.cs 项目: N3GUF/CPTools
        private void formCreateRejectFile_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (this.btnSendPayrollRejects.Enabled)
            {
                string           messageBoxText        = "Do you want to exit without sending Reject file to Regions?";
                string           caption               = "Reject File has not been Sent";
                MessageBoxButton button                = MessageBoxButton.YesNo;
                MessageBoxImage  icon                  = MessageBoxImage.Question;
                System.Windows.MessageBoxResult result = System.Windows.MessageBox.Show(messageBoxText, caption, button, icon);

                if (result == MessageBoxResult.No)
                {
                    e.Cancel = true;
                }
            }
        }
示例#10
0
 private void SaveBtn_Click(object sender, RoutedEventArgs e)
 {
     System.Windows.MessageBoxResult result = System.Windows.MessageBox.Show("Сохранить изменения?", "Сохранение", MessageBoxButton.YesNo, MessageBoxImage.Question);
     if (result == MessageBoxResult.Yes)
     {
         SqlCommandBuilder cmdbl = new SqlCommandBuilder(adapter);
         adapter.Update(dtMain);
         UpdateDataGridView();
     }
     else
     {
         SqlCommandBuilder cmdbl = new SqlCommandBuilder(adapter);
         adapter.Fill(dtMain);
         UpdateDataGridView();
     }
 }
示例#11
0
 private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     if (confirmOnClose == true)
     {
         System.Windows.MessageBoxResult result = System.Windows.MessageBox.Show("Data will be lost, you may save files first."
                                                                                 , "Are you sure?", System.Windows.MessageBoxButton.OKCancel);
         if (result == System.Windows.MessageBoxResult.OK)
         {
             e.Cancel = false;
         }
         else
         {
             e.Cancel = true;
         }
     }
 }
        /// <summary>
        /// Exporta la tabla seleccionada a un formato selccionado.
        /// </summary>
        /// <param name="exportTo"></param>
        /// <param name="view"></param>
        /// <param name="name"></param>
        public void exportTo(string exportTo, DevExpress.Xpf.Grid.TableView view, string name)
        {
            System.Windows.Forms.FolderBrowserDialog carpeta = new System.Windows.Forms.FolderBrowserDialog();
            carpeta.Description = "Seleccione la carpeta destino";
            carpeta.ShowDialog();
            DateTime thisDay = DateTime.Today;
            string   fecha   = thisDay.ToString("D");
            string   rout    = carpeta.SelectedPath;
            string   nombre  = name;

            if (exportTo == ".xsls")
            {
                if (!String.IsNullOrEmpty(rout))
                {
                    view.ExportToXlsx(rout + @"\Shark_" + nombre + "_" + fecha + ".xlsx");
                    System.Windows.MessageBoxResult dialogResult = System.Windows.MessageBox.Show("El Reporte se creó satisfactoriamente en la ubicación especificada, ¿Desea Abrir el Archivo? '", "Creación De Reporte", System.Windows.MessageBoxButton.YesNo);
                    if (dialogResult == System.Windows.MessageBoxResult.Yes)
                    {
                        System.Diagnostics.Process.Start(rout + @"\Shark_" + nombre + "_" + fecha + ".xlsx");
                    }
                }
            }
            else if (exportTo == ".png")
            {
                if (!String.IsNullOrEmpty(rout))
                {
                    view.ExportToImage(rout + @"\Shark_" + nombre + "_" + fecha + ".png");
                    System.Windows.MessageBoxResult dialogResult = System.Windows.MessageBox.Show("El Reporte se creó satisfactoriamente en la ubicación especificada, ¿Desea Abrir el Archivo? '", "Creación De Reporte", System.Windows.MessageBoxButton.YesNo);
                    if (dialogResult == System.Windows.MessageBoxResult.Yes)
                    {
                        System.Diagnostics.Process.Start(rout + @"\Shark_" + nombre + "_" + fecha + ".png");
                    }
                }
            }
            else if (exportTo == ".pdf")
            {
                if (!String.IsNullOrEmpty(rout))
                {
                    view.ExportToPdf(rout + @"\Shark_" + nombre + "_" + fecha + ".pdf");
                    System.Windows.MessageBoxResult dialogResult = System.Windows.MessageBox.Show("El Reporte se creó satisfactoriamente en la ubicación especificada, ¿Desea Abrir el Archivo? '", "Creación De Reporte", System.Windows.MessageBoxButton.YesNo);
                    if (dialogResult == System.Windows.MessageBoxResult.Yes)
                    {
                        System.Diagnostics.Process.Start(rout + @"\Shark_" + nombre + "_" + fecha + ".pdf");
                    }
                }
            }
        }
示例#13
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (inc < ListaPytan.Count)
                {
                    if (ListaPytan[inc - 1].Wynik == Int32.Parse(dzialanieBox.Text))
                    {
                        List[List.Count - 1].Punkty = List[List.Count - 1].Punkty + 1;
                    }
                    else
                    {
                        ListaPytanZle.Add(ListaPytan[inc - 1]);
                    }
                    this.dzialanieBlock.Text = ListaPytan[inc].Dzialanie;
                    this.dzialanieBox.Text   = "";
                    inc = inc + 1;
                }
                else
                {
                    if (ListaPytan[inc - 1].Wynik == Int32.Parse(dzialanieBox.Text))
                    {
                        List[List.Count - 1].Punkty = List[List.Count - 1].Punkty + 1;
                    }
                    else
                    {
                        ListaPytanZle.Add(ListaPytan[inc - 1]);
                    }
                    // DateTime centuryBegin = new DateTime(2001, 1, 1);
                    // DateTime currentDate2 = DateTime.Now;
                    //long elapsedTicks2 = currentDate2.Ticks - centuryBegin.Ticks;
                    // List[List.Count - 1].czasPrzejscia =new TimeSpan(elapsedTicks2);
                    //List[List.Count - 1].czasPrzejscia.Subtract(List[List.Count - 1]._tstart);
                    TimeSpan ts = (DateTime.Now - List[List.Count - 1]._tstart);
                    List[List.Count - 1].czasPrzejscia = ts.ToString(@"mm\:ss");
                    this.NavigationService.Navigate(new WyswietlRanking(List, ListaPytanZle));
                }
            }

            catch
            {
                System.Windows.MessageBoxResult result = MessageBox.Show("Podaj odpowiedź która jest liczbą",
                                                                         "Error",
                                                                         MessageBoxButton.OK,
                                                                         MessageBoxImage.Error);
            }
        }
        private void btnDeleteCustomer_Click(object sender, RoutedEventArgs e)
        {
            System.Windows.MessageBoxResult result = MessageBox.Show("Skutečně chcete smazat zákazníka: " + Customer.Name + " " + Customer.Surname + "?", "Potvrzení", MessageBoxButton.YesNo, MessageBoxImage.Exclamation);
            if (result == MessageBoxResult.Yes)
            {
                Configuration.DatabaseHelper.DeleteCustomer(Customer.Id);
                Configuration.MainWindow.customersListPage.ReloadDatagrid();

                Configuration.MainWindow.customersListPage.customerDetailsUserControl.Customer = null;
                Configuration.MainWindow.customersListPage.customerDetailsUserControl.Reload();
                this.Close();
            }
            else
            {
                return;
            }
        }
示例#15
0
        public void invoke7()
        {
            ProcessStartInfo psi = new ProcessStartInfo("cmd", "/C" + WIN7_maj1);

            psi.UseShellExecute        = false;
            psi.RedirectStandardOutput = true;
            psi.CreateNoWindow         = true;
            Process proc = Process.Start(psi);

            proc.WaitForExit();

            psi = new ProcessStartInfo("cmd", "/C" + WIN7_maj2);
            psi.UseShellExecute        = false;
            psi.RedirectStandardOutput = true;
            psi.CreateNoWindow         = true;
            proc = Process.Start(psi);
            proc.WaitForExit();

            psi = new ProcessStartInfo("cmd", "/C" + WIN7_maj3);
            psi.UseShellExecute        = false;
            psi.RedirectStandardOutput = true;
            psi.CreateNoWindow         = true;
            proc = Process.Start(psi);
            proc.WaitForExit();

            MessageBox.Show("Les mises à jours sont retirées, pour les masquer vous devez redemarer, relancer le logiciel, puis cliquer sur le bouton \"retirer mises a jour\"   ", "Redemarage",
                            MessageBoxButton.OK, MessageBoxImage.Information);


            System.Windows.MessageBoxResult result = MessageBox.Show("Voulez vous redemarer votre ordinateur maintenant? ", "Redemarage",
                                                                     MessageBoxButton.YesNo, MessageBoxImage.Warning);

            if (result == MessageBoxResult.Yes)
            {
                string d = "shutdown -r ";
                psi = new ProcessStartInfo("cmd", "/C " + d);
                psi.UseShellExecute        = false;
                psi.RedirectStandardOutput = true;
                psi.CreateNoWindow         = true;
                proc = Process.Start(psi);
                proc.WaitForExit();
            }
            else
            {
            }
        }
示例#16
0
        private static FileDialogResult ToFileDialogResult(MessageBoxResult result)
        {
            switch (result)
            {
            case MessageBoxResult.Yes:
                return(FileDialogResult.Yes);

            case MessageBoxResult.No:
                return(FileDialogResult.No);

            case MessageBoxResult.OK:
                return(FileDialogResult.OK);

            default:
                return(FileDialogResult.Cancel);
            }
        }
示例#17
0
 private void ExcluirAluno_Click(object sender, RoutedEventArgs e)
 {
     System.Windows.MessageBoxResult result = Xceed.Wpf.Toolkit.MessageBox.Show("Tem certeza que deseja excluir o aluno "
                                                                                + aluno.Nome + " do banco de dados?", "Confirmação", MessageBoxButton.YesNo, MessageBoxImage.Question);
     if (result.ToString().ToUpper() == "YES")
     {
         if (BDAluno.DeletaAluno(aluno.Cpf))
         {
             Xceed.Wpf.Toolkit.MessageBox.Show("Aluno excluido com sucesso!");
         }
         else
         {
             Xceed.Wpf.Toolkit.MessageBox.Show("Não foi possível deletar o aluno!");
         }
         mainWindow.MudarUserControl("aluno");
     }
 }
示例#18
0
        DialogResult Convert(sw.MessageBoxResult result)
        {
            switch (result)
            {
            case sw.MessageBoxResult.Cancel: return(DialogResult.Cancel);

            case sw.MessageBoxResult.No: return(DialogResult.No);

            case sw.MessageBoxResult.None: return(DialogResult.None);

            case sw.MessageBoxResult.Yes: return(DialogResult.Yes);

            case sw.MessageBoxResult.OK: return(DialogResult.Ok);

            default: throw new NotSupportedException();
            }
        }
示例#19
0
        //int n = 0;//TEST
        public override int Execute(params string[] parameters)
        {
            //n = 0;//TEST

            Win.MessageBoxResult result = Win.MessageBox.Show("Начать выгрузку FBX по слоям?", "Выгрузка FBX", Win.MessageBoxButton.YesNo);

            if (result == Win.MessageBoxResult.Yes)
            {
                try
                {
                    PluginRecord FBXPluginrecord = Application.Plugins.
                                                   FindPlugin("NativeExportPluginAdaptor_LcFbxExporterPlugin_Export.Navisworks");
                    if (FBXPluginrecord != null)
                    {
                        if (!FBXPluginrecord.IsLoaded)
                        {
                            FBXPluginrecord.LoadPlugin();
                        }

                        NativeExportPluginAdaptor FBXplugin = FBXPluginrecord.LoadedPlugin as NativeExportPluginAdaptor;

                        Document doc = Application.ActiveDocument;

                        string fbxPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
                        string docPath = doc.FileName;
                        if (!String.IsNullOrEmpty(docPath))
                        {
                            fbxPath = Path.GetDirectoryName(docPath);
                        }

                        DocumentModels docModels = doc.Models;
                        ModelItemEnumerableCollection rootItems = docModels.RootItems;
                        ExportByLayers(rootItems, fbxPath, docModels, FBXplugin);

                        Win.MessageBox.Show("Готово", "Готово", Win.MessageBoxButton.OK, Win.MessageBoxImage.Information);
                    }
                }
                catch (Exception ex)
                {
                    CommonException(ex, "Ошибка при экспорте в FBX по слоям");
                }
            }

            return(0);
        }
示例#20
0
        /// <summary>
        /// 清空所有获学位日期
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void bt_cleanAllHxwrq_Click(object sender, RoutedEventArgs e)
        {
            System.Windows.MessageBoxResult rs = System.Windows.MessageBox.Show("是否要删除所有学生的获学位日期?", "提示", MessageBoxButton.YesNo);
            if (rs == MessageBoxResult.No)
            {
                return;
            }
            else
            {
                DB.cleanAllHxwrq();

                List <StuFinal> stuFinalList = new List <StuFinal>();
                stuFinalList = DB.getStuFinalList();
                mw.dg_xwsbFinal.DataContext = stuFinalList;

                System.Windows.MessageBox.Show("已清空所有获学位日期");
            }
        }
示例#21
0
        private void btnMessageBoxWithResponse_Click(object sender, RoutedEventArgs e)
        {
            System.Windows.MessageBoxResult result = System.Windows.MessageBox.Show("Would you like to greet the world with a \"Hello, world\"?", "My App", MessageBoxButton.YesNoCancel);
            switch (result)
            {
            case System.Windows.MessageBoxResult.Yes:
                System.Windows.MessageBox.Show("Hello to you too!", "My App");
                break;

            case System.Windows.MessageBoxResult.No:
                System.Windows.MessageBox.Show("Oh well, too bad!", "My App");
                break;

            case System.Windows.MessageBoxResult.Cancel:
                System.Windows.MessageBox.Show("Nevermind then...", "My App");
                break;
            }
        }
        private void saveFolderChanged()
        {
            if (treeView.HasItems)
            {
                System.Windows.MessageBoxResult dialogResult =
                    System.Windows.MessageBox.Show("Changing save folder will empty the image file and source folder fields.\n" +
                                                   "Do you want to empty the file tree as well?", appName, MessageBoxButton.YesNo, MessageBoxImage.Question);

                if (dialogResult == System.Windows.MessageBoxResult.Yes)
                {
                    treeView.Items.Clear();
                }
            }

            if (!(bool)chkAbsolutePaths.IsChecked)
            {
                cmbIcon.Text         = "";
                cmbSourceFolder.Text = "";
            }
        }
示例#23
0
 /// <summary>
 /// Checks wether or not the currently loaded Controller has changes. If it does,
 /// the method offers the user to save them.
 /// </summary>
 /// <returns>True if there are unsaved changes, false if there are not or if
 /// the user decides to discard them.</returns>
 public bool ControllerHasChanged()
 {
     if (ControllerVM != null && ControllerVM.HasChanged)
     {
         System.Windows.MessageBoxResult r = System.Windows.MessageBox.Show("Wijzigingen opslaan?", "De regeling is gewijzigd. Opslaan?", System.Windows.MessageBoxButton.YesNoCancel);
         if (r == System.Windows.MessageBoxResult.Yes)
         {
             SaveFileCommand.Execute(null);
             if (ControllerVM.HasChanged)
             {
                 return(true);
             }
         }
         else if (r == System.Windows.MessageBoxResult.Cancel)
         {
             return(true);
         }
     }
     return(false);
 }
示例#24
0
        private bool TestChanged()
        {
            if (changed)
            {
                System.Windows.MessageBoxResult answer = MessageBox.Show(this, "There are unsaved changes. Do you really want to exit?", "Question", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No);

                if (answer != MessageBoxResult.Yes)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }
示例#25
0
 public static void ExportToXML(DataSet dataSet, System.Windows.Forms.SaveFileDialog v_dlgSave)
 {
     try
     {
         dataSet.WriteXml(v_dlgSave.FileName);
         Mouse.OverrideCursor = null;
         NoteBox.Show("Kết xuất dữ liệu ra file thành công", "", NoteBoxLevel.Note);
         //Neu chon mo file da luu
         System.Windows.MessageBoxResult result = NoteBox.Show("Bạn có muốn mở file xml vừa chọn kết xuất không?", "", NoteBoxLevel.Question);
         if (System.Windows.MessageBoxResult.Yes == result)
         {
             Process.Start(v_dlgSave.FileName);
         }
     }
     catch (Exception ex)
     {
         Mouse.OverrideCursor = null;
         CommonData.log.Error(ex.ToString());
     }
 }
示例#26
0
        protected override void OnPageBackKeyPressOverride(System.ComponentModel.CancelEventArgs e)
        {
            // Cancels the back key event.
            e.Cancel = true;

            // Do nothing if the page is not ready.
            lock (_syncRoot)
            {
                if (!_isStartProcessLaunched)
                {
                    return;
                }
            }

            // Ask if we really want to leave the game.
            System.Windows.MessageBoxResult result = System.Windows.MessageBoxResult.None;
            try
            {
                result = System.Windows.MessageBox.Show(
                    "The game will stop and your unsaved progress will be lost.",
                    "Exit to main menu?",
                    MessageBoxButton.OKCancel);
            }
            catch (Exception ex)
            {
                // An exception with message "0x8000ffff" is thrown if this message box
                // is requested to be shown a second time while the first request has
                // still not been processed. In this case, do nothing and hope that
                // the user has better luck next time. In other cases, throw the exception
                // back.
                if (ex.Message == null || !ex.Message.Contains("0x8000ffff"))
                {
                    throw;
                }
            }
            if (result == System.Windows.MessageBoxResult.OK)
            {
                // Leaves to main menu and stops the game.
                App.Current.ViewModel.NavigationManager.NavigateToAppHome(true);
            }
        }
示例#27
0
        private static MessageBoxResult FromWpfMessageBoxResult(System.Windows.MessageBoxResult result)
        {
            switch (result)
            {
            case System.Windows.MessageBoxResult.None:
            case System.Windows.MessageBoxResult.Cancel:
                return(MessageBoxResult.Cancel);

            case System.Windows.MessageBoxResult.Yes:
                return(MessageBoxResult.Yes);

            case System.Windows.MessageBoxResult.No:
                return(MessageBoxResult.No);

            case System.Windows.MessageBoxResult.OK:
                return(MessageBoxResult.Ok);

            default:
                throw new ArgumentException($"System.Windows.MessageBoxResult {result} not handled!");
            }
        }
示例#28
0
 private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     if (exit == false)
     {
         System.Windows.MessageBoxResult result = MessageBox.Show("Вы действительно хотите выйти?\nРезультаты тестирования не сохранятся!", "ВНИМАНИЕ", MessageBoxButton.YesNo, MessageBoxImage.Question);
         if (result == MessageBoxResult.Yes)
         {
             MainWindow mainWindow = new MainWindow();
             mainWindow.Show();
         }
         else
         {
             e.Cancel = true;
         }
     }
     else
     {
         MainWindow mainWindow = new MainWindow();
         mainWindow.Show();
     }
 }
示例#29
0
        public MainWindow()
        {
            InitializeComponent();

            string[] entries = Directory.GetFiles(Directory.GetCurrentDirectory());

            if (entries.ToList().Contains(Directory.GetCurrentDirectory() + "\\restore"))
            {
                System.Windows.MessageBoxResult result = System.Windows.MessageBox.Show("Do you want to restore the last session", "Noctis", MessageBoxButton.YesNo);
                if (result == MessageBoxResult.Yes)
                {
                    using (StreamReader reader = new StreamReader("restore"))
                    {
                        this.path = reader.ReadLine();
                        parser.processDirectory(path, 0, null);
                        updateList();
                        reader.Close();
                    }
                }
            }
        }
示例#30
0
 private void ButtonAssignTo_Click(object sender, RoutedEventArgs e)
 {
     YellowstonePathology.Business.User.SystemUser systemUser = (YellowstonePathology.Business.User.SystemUser) this.ComboBoxAssignedToSelection.SelectedItem;
     System.Windows.MessageBoxResult result = System.Windows.MessageBox.Show("Assign selected cases to " + systemUser.DisplayName + "?", "Assign selected cases?", MessageBoxButton.OKCancel);
     if (result == MessageBoxResult.OK)
     {
         List <YellowstonePathology.Business.Search.CytologyScreeningSearchResult> cytologyScreeningSearchResult = new List <YellowstonePathology.Business.Search.CytologyScreeningSearchResult>();
         foreach (YellowstonePathology.Business.Search.CytologyScreeningSearchResult listItem in this.ListViewSearchResults.SelectedItems)
         {
             cytologyScreeningSearchResult.Add(listItem);
         }
         if (cytologyScreeningSearchResult.Count > 0)
         {
             this.m_CytologyUI.AssignScreenings(cytologyScreeningSearchResult, systemUser);
         }
         else
         {
             System.Windows.MessageBox.Show("No items selected to assign.");
         }
     }
 }
示例#31
0
        private void ExitApp(object sender, RoutedEventArgs e)
        {
            if (grantTrees.filteredTree != null)
            {
                System.Windows.MessageBoxResult dialogResult = MessageBox.Show("Do you want to save the project before closing?", this.Title + " Close", MessageBoxButton.YesNoCancel);
                switch (dialogResult)
                {
                case MessageBoxResult.Cancel:
                    break;

                case MessageBoxResult.No:
                    this.Close();
                    break;

                case MessageBoxResult.Yes:
                    SaveButton_Click(sender, e);
                    this.Close();
                    break;
                }
            }
            this.Close();
        }
示例#32
0
        private void Service_RequestConfirmCloseMessageDialog(object sender, MessageBoxEventArgs e)
        {
            System.Windows.MessageBoxResult result = MessageBox.Show(e.Message, e.Title, MessageBoxButton.YesNoCancel, MessageBoxImage.Information);
            switch (result)
            {
            case System.Windows.MessageBoxResult.Yes:
                e.Result = MessageBoxResult.Yes;
                break;

            case System.Windows.MessageBoxResult.No:
                e.Result = MessageBoxResult.No;
                break;

            case System.Windows.MessageBoxResult.Cancel:
                e.Result = MessageBoxResult.Cancel;
                break;

            default:
                e.Result = MessageBoxResult.None;
                break;
            }
        }
示例#33
0
 public override void Execute(CoroutineExecutionContext context)
 {
     Result = MessageBox.Show(text, caption, buttons);
     base.Execute(context);
 }
 public Dial_Declinar_SeguroFunerario()
 {
     InitializeComponent();
     this.Resultado = MessageBoxResult.No;
 }
 public override void Execute(Caliburn.Micro.ActionExecutionContext context)
 {
     Result = MessageBox.Show(StringParser.Parse(text), StringParser.Parse(caption), buttons);
     base.Execute(context);
 }
示例#36
0
 private static FileDialogResult ToFileDialogResult(MessageBoxResult result)
 {
     switch (result)
     {
         case MessageBoxResult.Yes:
             return FileDialogResult.Yes;
         case MessageBoxResult.No:
             return FileDialogResult.No;
         case MessageBoxResult.OK:
             return FileDialogResult.OK;
         default:
             return FileDialogResult.Cancel;
     }
 }
 public Dial_confirmacion_cambio_estado_sf()
 {
     InitializeComponent();
     this.Resultado = MessageBoxResult.No;
 }
示例#38
0
 public override void Execute(Caliburn.Micro.ActionExecutionContext context)
 {
     Result = MessageBox.Show(text, caption, buttons);
     base.Execute(context);
 }
 private void But_No_Click(object sender, RoutedEventArgs e)
 {
     this.Resultado = MessageBoxResult.No;
     this.Hide();
 }
 private void But_Aceptar_Click(object sender, RoutedEventArgs e)
 {
     this.Resultado = MessageBoxResult.Yes;
     this.Hide();
 }
 public Dial_confirmacion_AprobacionSeguroFunerario(){
     InitializeComponent();
     this.Resultado = MessageBoxResult.No;
 }