private void btnSelectTemplateDoc_Click(object sender, EventArgs e) { if (ModifierKeys == Keys.Shift) { var msgBox = new ClearCanvas.Desktop.View.WinForms.MessageBox(); if (msgBox.Show(@"Do you want to select default template?", MessageBoxActions.YesNo) == DialogBoxAction.Yes) { SetNewTemplateDocument(null); return; } } var openFileDialog = new OpenFileDialog(); openFileDialog.DefaultExt = "xml"; openFileDialog.Filter = @"XML Files (*.xml)|*.xml|All Files|*.*"; openFileDialog.Title = @"Open AIM Template File"; openFileDialog.Multiselect = false; openFileDialog.RestoreDirectory = true; openFileDialog.InitialDirectory = _component.SelectedAimTemplateLocalFolder; if (openFileDialog.ShowDialog(this) == DialogResult.OK) { SetNewTemplateDocument(openFileDialog.FileName); } }
/// <summary> /// Displays a message box. /// </summary> /// <remarks> /// Override this method if you need to customize the display of message boxes. /// </remarks> /// <param name="message"></param> /// <param name="actions"></param> /// <returns></returns> public virtual DialogBoxAction ShowMessageBox(string message, MessageBoxActions actions) { MessageBox mb = new MessageBox(); return mb.Show(message, actions); }