コード例 #1
0
        private void downloadGitRepoButtonX_Click(object sender, EventArgs e)
        {
            eTaskDialogButton button = eTaskDialogButton.Yes;

            button |= eTaskDialogButton.No;

            eTaskDialogResult result = TaskDialog.Show(new TaskDialogInfo("Are you sure?", eTaskDialogIcon.Hand, "Are you sure?", String.Format("By doing this, you will replace the databases: \"{0}\", \"{1}\", and \"{2}\". Are you sure you want to continue?", authDB, charDB, worldDB), button));

            if (result == eTaskDialogResult.Yes)
            {
                if (DBFolderBrowserDialog.ShowDialog() == DialogResult.OK)
                {
                    aDB = authDB;
                    cDB = charDB;
                    wDB = worldDB;

                    location = DBFolderBrowserDialog.SelectedPath;

                    MySQLPercentLabelX.Visible  = true;
                    DBProgressBarX.Visible      = true;
                    DBProgressBarX.ProgressType = eProgressItemType.Standard;


                    downloadGitRepoButtonX.Enabled = false;

                    gitBackgroundWorker.RunWorkerAsync(location);
                }
            }
        }
コード例 #2
0
        private void restoreButtonX_Click(object sender, EventArgs e)
        {
            if (backupListBox.SelectedIndex != -1)
            {
                if (restoreDBBackgroundWorker.IsBusy)
                {
                    TaskDialog.Show(new TaskDialogInfo("Try again later", eTaskDialogIcon.Stop, "Restore Currently in Progress", "Try again after it has been completed", eTaskDialogButton.Ok));
                }
                else
                {
                    eTaskDialogButton button = eTaskDialogButton.Yes;
                    button |= eTaskDialogButton.No;

                    eTaskDialogResult result = TaskDialog.Show(new TaskDialogInfo("Confirm", eTaskDialogIcon.Hand, "Are you sure?", String.Format("This will overwrite the databases: {0}, {1}, {2}. Once the restore has been started, it cannot be stopped.", Settings.Default.AuthDB, Settings.Default.CharactersDB, Settings.Default.WorldDB), button));

                    if (result == eTaskDialogResult.Yes)
                    {
                        restoreCircularProgress.IsRunning = true;

                        restoreDBBackgroundWorker.RunWorkerAsync(backupListBox.Items[backupListBox.SelectedIndex].ToString());
                    }
                }
            }
            else
            {
                TaskDialog.Show(new TaskDialogInfo("Error", eTaskDialogIcon.Stop, "No Backup Selected", "Please select a backup, then try again.", eTaskDialogButton.Ok));
            }
        }
コード例 #3
0
ファイル: Form1.cs プロジェクト: xy19xiaoyu/DotNetBar2Demos
        private void buttonX1_Click(object sender, EventArgs e)
        {
            TaskDialogInfo info = CreateTaskDialogInfo();

            eTaskDialogResult result = TaskDialog.Show(info);

            Log("{0} Task-dialog closed with result: {1}", DateTime.Now, result);
        }
コード例 #4
0
ファイル: UIHelper.cs プロジェクト: GaryHan4451/MTStorage
 /// <summary>
 /// 任务栏对话框
 /// </summary>
 /// <param name="title">窗口标题</param>
 /// <param name="header">内容标题</param>
 /// <param name="content">内容</param>
 public static void TaskDialogNotify(string title, string header, string content)
 {
     TaskDialogInfo info = new TaskDialogInfo(title, eTaskDialogIcon.Users,
                                              header, content, eTaskDialogButton.Ok,
                                              eTaskDialogBackgroundColor.DarkBlue,
                                              null, null, null, "Designed  by POLC AED", Resource1.user);
     eTaskDialogResult result = TaskDialog.Show(info);
 }
コード例 #5
0
        /// <summary>
        /// 跳出Yes、No的對話框
        /// </summary>
        /// <param name="dialogText"></param>
        /// <param name="dialogIcon"></param>
        /// <param name="dialogTitle"></param>
        /// <param name="dialogHeader"></param>
        /// <returns></returns>
        public static eTaskDialogResult ShowMsgYesNo(string dialogText, eTaskDialogIcon dialogIcon = eTaskDialogIcon.Help, string dialogTitle = "Message", string dialogHeader = "")
        {
            eTaskDialogButton          dialogButtons = eTaskDialogButton.Yes | eTaskDialogButton.No;
            eTaskDialogBackgroundColor dialogColor   = eTaskDialogBackgroundColor.Silver;
            eTaskDialogResult          result        = TaskDialog.Show(dialogTitle, dialogIcon, dialogHeader, dialogText, dialogButtons, dialogColor);

            return(result);
        }
コード例 #6
0
        private void btnCancel_Click(object sender, EventArgs e)
        {
            TaskDialogInfo    tResult = new TaskDialogInfo("THOÁT CHƯƠNG TRÌNH", eTaskDialogIcon.Information, "", "Bạn có đồng ý thoát khỏi chương trình này không?", eTaskDialogButton.Yes);
            eTaskDialogResult result  = TaskDialog.Show(tResult);

            if (result == eTaskDialogResult.Yes)
            {
                Application.Exit();
            }
        }
コード例 #7
0
        private void deleteAdjuntoTemp(string fileName)
        {
            List <DocumentoBE> lstDocumentoBE = new List <DocumentoBE>();
            eTaskDialogResult  result         = ucMsgBox1.ShowMessageConfirmation("¿Desea eliminar el archivo seleccionado?");

            if (result == eTaskDialogResult.Yes)
            {
                if (dgvAdjuntos.DataSource != null)
                {
                    lstDocumentoBE.AddRange((List <DocumentoBE>)dgvAdjuntos.DataSource);
                }

                lstDocumentoBE.Remove(lstDocumentoBE.Find(x => x.nombre == fileName));
                dgvAdjuntos.DataSource = lstDocumentoBE;
            }
        }
コード例 #8
0
ファイル: Efecto.cs プロジェクト: Dynases/Dino_Avicola
        void MP_MostrarMensajeDelete()
        {
            TaskDialogInfo    info      = new TaskDialogInfo(Context, eTaskDialogIcon.Delete, "ADVERTENCIA", Header, eTaskDialogButton.Yes | eTaskDialogButton.Cancel, eTaskDialogBackgroundColor.Default);
            eTaskDialogResult resultado = TaskDialog.Show(info);

            if (resultado == eTaskDialogResult.Yes)
            {
                string mensajeError = "";
                Band = true;
                this.Close();
            }
            else
            {
                Band = true;
                this.Close();
            }
        }
コード例 #9
0
        private void UserSettings_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (!finished)
            {
                eTaskDialogButton button = eTaskDialogButton.Yes;

                button |= eTaskDialogButton.No;

                eTaskDialogResult result = TaskDialog.Show(new TaskDialogInfo("Are you sure?", eTaskDialogIcon.Exclamation, "Confirm", "Are you sure you want to exit the setup wizard?", button));

                if (result == eTaskDialogResult.Yes)
                {
                    finished = true;

                    if (Settings.Default.raEnabled)
                    {
                        if (Settings.Default.raHost != String.Empty && Settings.Default.raPort != 0 && Settings.Default.raUsername != String.Empty && Settings.Default.raPassword != String.Empty)
                        {
                            e.Cancel = false;

                            return;
                        }
                    }
                    else
                    {
                        if (Settings.Default.trinityFolder != String.Empty)
                        {
                            e.Cancel = false;

                            return;
                        }
                    }


                    TaskDialog.Show(new TaskDialogInfo("Wizard Failed", eTaskDialogIcon.Stop, "You failed to complete the setup wizard...", "TrinityCore Manager is now closing", eTaskDialogButton.Ok));

                    Application.Exit();
                }
                else
                {
                    e.Cancel = true;
                }
            }
        }
コード例 #10
0
        private void Form1_Shown(object sender, EventArgs e)
        {
            this.mySideNav1.SetItemsTheme();
            this.sideNavItemExit.Click += (s, e2) =>
            {
                TaskDialogInfo info = new TaskDialogInfo("警告", eTaskDialogIcon.Stop, "是否退出?", "", eTaskDialogButton.Yes | eTaskDialogButton.No,
                                                         eTaskDialogBackgroundColor.Default, null, null, null, "", null);
                eTaskDialogResult result = TaskDialog.Show(info);
                if (result == eTaskDialogResult.Yes)
                {
                    this.Close();
                }
            };

            this.WindowState   = FormWindowState.Normal;
            this.StartPosition = FormStartPosition.Manual;
            this.Left          = (Screen.PrimaryScreen.Bounds.Width - this.Width) / 2;
            this.Top           = (Screen.PrimaryScreen.Bounds.Height - this.Height) / 2;
        }
コード例 #11
0
        private void LootCreator_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (!finished)
            {
                eTaskDialogButton button = eTaskDialogButton.Yes;

                button |= eTaskDialogButton.No;

                eTaskDialogResult result = TaskDialog.Show(new TaskDialogInfo("Are you sure?", eTaskDialogIcon.Exclamation, "Confirm", "Are you sure you want to exit?", button));

                if (result == eTaskDialogResult.Yes)
                {
                    finished = true;
                }
                else
                {
                    e.Cancel = true;
                }
            }
        }
コード例 #12
0
        private void gitProc_ErrorDataReceived(object sender, DataReceivedEventArgs e)
        {
            string message = e.Data;

            if (message != null)
            {
                if (message.Contains("fatal"))
                {
                    this.Invoke((MethodInvoker) delegate
                    {
                        eTaskDialogResult result = TaskDialog.Show(new TaskDialogInfo("Error", eTaskDialogIcon.Stop, "Error!", e.Data, eTaskDialogButton.Ok));
                    });
                }
                else
                {
                    if (this.InvokeRequired)
                    {
                        this.Invoke((MethodInvoker) delegate
                        {
                            if (message.Contains("%"))
                            {
                                string[] ex = message.Split(char.Parse("%"));

                                int index = ex[0].LastIndexOf(char.Parse(" "));

                                string percent = ex[0].Substring(index);

                                int GitPercent = 0;

                                int.TryParse(percent, out GitPercent);

                                DBProgressBarX.Value = GitPercent;

                                MySQLPercentLabelX.Text = percent + "%";
                                MySQLPercentLabelX.Left = (setupTCDBWizardPage.Width / 2) - (MySQLPercentLabelX.Width / 2);
                            }
                        });
                    }
                }
            }
        }
コード例 #13
0
        public DialogResult ShowDialog()
        {
            eTaskDialogResult result = TaskDialog.Show(_info);

            if (result == eTaskDialogResult.Ok)
            {
                _result = DialogResult.OK;
            }
            if (result == eTaskDialogResult.Cancel)
            {
                _result = DialogResult.Cancel;
            }
            if (result == eTaskDialogResult.Yes)
            {
                _result = DialogResult.Yes;
            }
            if (result == eTaskDialogResult.No)
            {
                _result = DialogResult.No;
            }

            return(_result);
        }
コード例 #14
0
        private void buttonX6_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(txtRuta.Text) || String.IsNullOrEmpty(txtHoja.Text) || String.IsNullOrEmpty(cmbTypeOfAud.Text))
            {
                MessageBox.Show(
                    "Por favor carga Archivo," +
                    " nombre de hoja Excel " +
                    " y selecciona tipo de auditoria para continuar", "AudSemp",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Information);

                return;
            }


            if (cmbTypeOfAud.Text == "Auditar Contratos")
            {
                Opcion = 1;


                accion();
                backgroundWorker1.RunWorkerAsync();
            }
            ;
            if (cmbTypeOfAud.Text == "Auditar Bolsas")
            {
                TaskDialogInfo    info   = CreateTaskDialogInfoInv();
                eTaskDialogResult result = TaskDialog.Show(info);
            }
            ;
            if (cmbTypeOfAud.Text == "Auditar Inventarios")
            {
                TaskDialogInfo    info   = CreateTaskDialogInfoInv();
                eTaskDialogResult result = TaskDialog.Show(info);
            }
            ;
        }
コード例 #15
0
        private void gitBackgroundWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            if (e.Argument is string)
            {
                try
                {
                    ProcessStartInfo psi = new ProcessStartInfo();

                    string loc = e.Argument as string;

                    psi.WorkingDirectory = loc;


                    string git = String.Empty;

                    if (Environment.Is64BitOperatingSystem == true)
                    {
                        git = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), "Git", "bin", "git.exe");
                    }
                    else
                    {
                        git = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "Git", "bin", "git.exe");
                    }

                    psi.FileName = git;

                    if (!File.Exists(git))
                    {
                        this.Invoke((MethodInvoker) delegate
                        {
                            eTaskDialogResult result = TaskDialog.Show(new TaskDialogInfo("Git not found!", eTaskDialogIcon.Stop, "Git Not Found!", "You can download Git here: http://git-scm.com - You must install it in the Program Files Directory!", eTaskDialogButton.Ok));
                        });

                        e.Cancel = true;

                        return;
                    }

                    if (Directory.Exists(Path.Combine(loc, "TrinityCore", ".git")) || Directory.Exists(Path.Combine(loc, ".git")))
                    {
                        psi.Arguments = "pull -v --progress";

                        if (!Directory.Exists(Path.Combine(loc, ".git")))
                        {
                            psi.WorkingDirectory = Path.Combine(loc, "TrinityCore");
                        }
                    }
                    else
                    {
                        psi.Arguments = "clone -v --progress https://github.com/TrinityCore/TrinityCore.git";
                    }

                    psi.RedirectStandardOutput = true;
                    psi.RedirectStandardError  = true;
                    psi.UseShellExecute        = false;
                    psi.CreateNoWindow         = true;
                    psi.WindowStyle            = ProcessWindowStyle.Hidden;

                    Process gitProc = new Process();
                    gitProc.StartInfo = psi;

                    gitProc.Start();

                    gitProc.EnableRaisingEvents = true;

                    gitProc.BeginOutputReadLine();
                    gitProc.OutputDataReceived += new DataReceivedEventHandler(gitProc_OutputDataReceived);

                    gitProc.BeginErrorReadLine();
                    gitProc.ErrorDataReceived += new DataReceivedEventHandler(gitProc_ErrorDataReceived);

                    gitProc.Exited += new EventHandler(gitProc_Exited);

                    gitProc.WaitForExit();
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
            }
        }
コード例 #16
0
 /// <summary>
 /// Closes the task dialog if it is open with specified result value.
 /// </summary>
 /// <param name="result">Value that will be used as return value from Show method.</param>
 public static void Close(eTaskDialogResult result)
 {
     if (_TaskDialogForm == null)
         throw new NullReferenceException("Task Dialog Form is not shown.");
     _TaskDialogForm.CloseDialog(result);
 }
コード例 #17
0
 internal void CloseDialog(eTaskDialogResult result)
 {
     _Result = result;
     this.Close();
 }