A warning dialog that we can't quite do with MessageBox because custom text is required for the "Yes" button.
Наследование: System.Windows.Forms.Form
Пример #1
0
 private bool ShowConfirmDeleteDialog(string wsDisplayLabel)
 {
     // If there is no cache then we are probably creating a new language project.
     // In any case, we don't need to warn about data being deleted if there is no project.
     if (_model.Cache == null)
     {
         return(true);
     }
     using (var dlg = new DeleteWritingSystemWarningDialog())
     {
         dlg.SetWsName(wsDisplayLabel);
         return(dlg.ShowDialog() == DialogResult.Yes);
     }
 }
Пример #2
0
		private void DeleteListItem(CheckedListBox list)
		{
			// If the writing system is in the other list as well, simply hide it silently.
			var otherList = list == m_lstAnalWs ? m_lstVernWs : m_lstAnalWs;
			if (otherList.Items.Contains(GetCurrentSelectedWs(list)))
			{
				HideListItem(list);
				return;
			}

			using (var dlg = new DeleteWritingSystemWarningDialog())
			{
				dlg.SetWsName(GetCurrentSelectedWs(list).ToString());
				if (dlg.ShowDialog(this) == DialogResult.Yes)
				{
					m_deletedWritingSystems.Add(GetCurrentSelectedWs(list));
					HideListItem(list);
				}
			}
		}