/// <summary> /// 上传规格书 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button4_Click(object sender, EventArgs e) { if (!AlertInfo()) { return; } M_Specifications m_Specifications = GetM_Specifications(); TaskDialogInfo info = new TaskDialogInfo("提示", eTaskDialogIcon.ShieldHelp, "是否确定上传规格书!!!", "", GetTaskDialogButtons()); string returnStr = TaskDialog.Show(info).ToString(); if (returnStr.Equals("Yes")) { string str = string.Empty; string img = string.Empty; str = b_GetMethod.HandleSpecifications(m_Specifications, M_SQLType.Insert); if (str.Equals("上传规格书成功")) { img = @"../../Images/success.png"; } else { img = @"../../Images/Error.png"; } ToastNotification.CustomGlowColor = Color.FromArgb(48, 32, 22); ToastNotification.Show(this, str, BLL.B_GetMethod.ReadImageFile(img), 2000, eToastGlowColor.Red, eToastPosition.MiddleCenter); } }
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); }
/// <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); }
// R o m C h a n g e s N o t i f i c a t i o n private void NotifyRomChangesAvailable(ref bool mute) { var notifyMode = Settings.General.RomChangedNotification; bool showWarningBox = notifyMode == NotificationMode.Infobox; // Show popup if (notifyMode == NotificationMode.Popup && !mute) { var tdinfo = new TaskDialogInfo() { Title = Form_Main_Resources.MsgBox_RomChanged_Title, Header = Form_Main_Resources.MsgBox_RomChanged_Title, TaskDialogIcon = eTaskDialogIcon.Information, Text = Form_Main_Resources.MsgBox_RomChanged, DialogButtons = eTaskDialogButton.Yes | eTaskDialogButton.No }; switch (TaskDialog.Show(tdinfo)) { case eTaskDialogResult.Yes: Controller.ReloadRom(); showWarningBox = false; break; default: showWarningBox = true; mute = true; break; } } // Create WarningBox if (showWarningBox && WarningBox_RomChanged is null) { WarningBox_RomChanged = new WarningBox() { Text = Form_Main_Resources.WarningBox_RomChanged_Text, OptionsText = Form_Main_Resources.WarningBox_RomChanged_ReloadRom, Dock = DockStyle.Top, CloseButtonVisible = false }; WarningBox_RomChanged.OptionsClick += WarningBox_RomChanged_OptionsClick; WarningBox_RomChanged.CloseClick += WarningBox_RomChanged_CloseClick; } // Set Warningbox size and add it if (WarningBox_RomChanged is object && showWarningBox) { if (!Panel1.Controls.Contains(WarningBox_RomChanged)) { Panel1.Controls.Add(WarningBox_RomChanged); } TabControl1.Top += WarningBox_RomChanged.Height; TabControl1.Height -= WarningBox_RomChanged.Height; WarningBox_RomChanged.Visible = true; WarningBox_RomChanged.BringToFront(); } }
private TaskDialogInfo CreateTaskDialogInfo() { TaskDialogInfo info = new TaskDialogInfo(textBoxTitle.Text, (eTaskDialogIcon)Enum.Parse(typeof(eTaskDialogIcon), comboBoxIcon.Text), textBoxHeader.Text, textBoxContent.Text, GetTaskDialogButtons(), (eTaskDialogBackgroundColor)Enum.Parse(typeof(eTaskDialogBackgroundColor), comboBoxColor.Text), GetRadioButtons(), GetCommandButtons(), GetCheckBoxCommand(), textBoxFooter.Text, GetFooterImage()); return(info); }
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(); } }
private TaskDialogInfo CreateTaskDialogInfoInv() { TaskDialogInfo info = new TaskDialogInfo("AudSemp", eTaskDialogIcon.Information, "¿Que Tipo de Inventarios Voy Auditar?", "", eTaskDialogButton.Cancel, eTaskDialogBackgroundColor.Blue, null, GetCommandButtonsInvs(), null, "", null); return(info); }
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(); } }
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; }
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); } ; }
public ThreatModelInUseAction Show(string owner, string machine, DateTime timestamp, int count) { var builder = new StringBuilder(); builder.Append( $"The selected Threat Model is already used by <b>{owner}</b> on {machine} and therefore it cannot be opened."); builder.Append("<br/>"); builder.Append($"{count} other users are queued to work on it, after its release."); builder.Append("<br/>"); var interval = DateTime.Now - timestamp; if (interval > TimeSpan.FromHours(4)) { builder.Append( $"<b><br/>The lock may be stale</b>, because it has been established more than {(int) interval.TotalHours} hours ago. You may want to contact <b>{owner}</b>."); } builder.Append("<br/><br/>Please choose how to continue.<br/><br/>"); var taskDialogInfo = new TaskDialogInfo("Threat Model already in use", eTaskDialogIcon.Stop2, "The Threat Model cannot be opened", builder.ToString(), eTaskDialogButton.Close, eTaskDialogBackgroundColor.Red); var workWithCopyNotifyCommand = new Command() { Image = null, Name = "workWithCopyNotifyCommand", Text = "I'll work on a copy and I'll merge when I will notified<br/>that the document has been released." }; workWithCopyNotifyCommand.Executed += Executed; var workWithCopyCommand = new Command() { Image = null, Name = "workWithCopyCommand", Text = "I'll work on a copy and I'll merge later.<br/>No notification is necessary." }; workWithCopyCommand.Executed += Executed; var waitCommand = new Command() { Image = null, Name = "waitCommand", Text = "I'll wait for the document to be released.<br/>Please notify me when it occurs." }; waitCommand.Executed += Executed; var nothingCommand = new Command() { Image = null, Name = "nothingCommand", Text = "No worries, I will try again later.", Checked = true }; nothingCommand.Executed += Executed; taskDialogInfo.RadioButtons = new [] { workWithCopyNotifyCommand, workWithCopyCommand, waitCommand, nothingCommand }; TaskDialog.Show(taskDialogInfo); return(_action); }
public AisinoMessageBox(string textTitle, string textHead, AisinoMessageButton btn, AisinoMessageIcon ico) { _info = new TaskDialogInfo(textTitle, (eTaskDialogIcon)ico, textHead, null, (eTaskDialogButton)btn, eTaskDialogBackgroundColor.Blue, null, null, null, null, null); }
public AisinoMessageBox(string textTitle, string textHead, string textFoot, AisinoMessageButton btn, AisinoMessageIcon ico) { _info = new TaskDialogInfo(textTitle, (eTaskDialogIcon)ico, textHead, null, (eTaskDialogButton)btn, eTaskDialogBackgroundColor.Blue, null, null, null, textFoot, Aisino.MES.Client.Common.Properties.Resources.About); }
internal static void SaveRom(RomManager rommgr) { if (rommgr is object) { bool dontpatchupdates; RomWatcher.EnableRaisingEvents = false; if (rommgr.AreRomUpdatesAvaiable()) { var switchExpr = Settings.General.ActionIfUpdatePatches; switch (switchExpr) { case DialogResult.Yes: dontpatchupdates = false; break; case DialogResult.No: dontpatchupdates = true; break; default: var tdi = new TaskDialogInfo(Form_Main_Resources.MsgBox_UpdatePatchesAvaiable_Title, eTaskDialogIcon.ShieldHelp, Form_Main_Resources.MsgBox_UpdatePatchesAvaiable_Title, Form_Main_Resources.MsgBox_UpdatePatchesAvaiable, eTaskDialogButton.Yes | eTaskDialogButton.No | eTaskDialogButton.Cancel); tdi.CheckBoxCommand = new Command() { Text = "Don't show this message again." }; var switchExpr1 = TaskDialog.Show(tdi); switch (switchExpr1) { case eTaskDialogResult.Yes: dontpatchupdates = false; if (tdi.CheckBoxCommand.Checked) { Settings.General.ActionIfUpdatePatches = DialogResult.Yes; } break; case eTaskDialogResult.No: dontpatchupdates = true; if (tdi.CheckBoxCommand.Checked) { Settings.General.ActionIfUpdatePatches = DialogResult.No; } break; default: return; } if (!tdi.CheckBoxCommand.Checked) { Settings.General.ActionIfUpdatePatches = DialogResult.None; } break; } } else { dontpatchupdates = false; } rommgr.SaveRom( DontPatchUpdates: dontpatchupdates, recalcChecksumBehavior: Settings.General.RecalcChecksumBehavior); RomWatcher.EnableRaisingEvents = true; } }