コード例 #1
0
		public void ShowEditor(IObjectEditor editor) {
			ObjectEditorForm f = FindObjectEditor(editor);
 			if (f == null) {
				f = new ObjectEditorForm((IObjectEditor)editor);
				try {
					f.Show(((IMdiContainer)_mdiParent).DockPanel);
				}
				catch (Exception ex) {
					MessageBox.Show(ex.ToString());
				}
 			}
 			else {
 				f.Activate();
 			}
		}
コード例 #2
0
		private bool CloseDocuments() {
			ObjectEditorForm[] forms = new ObjectEditorForm[DockPanel.Documents.Length];
			int c = 0;
			foreach (object form in DockPanel.Documents) {
				if (form is ObjectEditorForm) {
					forms[c++] = (ObjectEditorForm) form;
				}
			}
			foreach (ObjectEditorForm form in forms) {
				bool cancel = false;
				form.UnloadEditorPanel(out cancel);
				if (cancel) {
					return false;
				}
				form.Close();
			}
			SaveDockSettings();
			return true;
		}
コード例 #3
0
		public DialogResult ShowEditorDialog(IObjectEditor editor) {
			ObjectEditorForm f = new ObjectEditorForm((IObjectEditor)editor);
			f.StartPosition = FormStartPosition.CenterScreen;
			return f.ShowDialog(_mdiParent);
		}