void OnDocumentChanged(IDocumentForm document) { if (DocumentChanged != null) { DocumentChanged(document); } }
void mnuRedo_Click(object sender, EventArgs e) { IDocumentForm document = GetDocument(); if (document != null) { document.Redo(); } }
void mnuPaste_Click(object sender, EventArgs e) { IDocumentForm document = GetDocument(); if (document != null) { document.Paste(); } }
void mnuCopy_Click(object sender, EventArgs e) { IDocumentForm document = GetDocument(); if (document != null) { document.Copy(); } }
void DefaultEditor_DocumentChanged(IDocumentForm document) { SetDocumentMenus(document); if (dockPanel1.ActiveContent == document) { SetContentMenus(document); } }
private void DefaultEditorDocumentChanged(IDocumentForm document) { this.SetDocumentMenus(document); if (this.dockPanel1.ActiveContent == document) { this.SetContentMenus(document); } }
void mnuSelectAll_Click(object sender, EventArgs e) { IDocumentForm document = GetDocument(); if (document != null) { document.SelectAll(); } }
void mnuChangeVisibility_Click(object sender, EventArgs e) { IDocumentForm content = GetDocument(); if (content != null) { content.ChangeVisibility(); } }
private void ContextMenuStrip1Opening(object sender, CancelEventArgs e) { IDocumentForm document = this.GetDocument(); if (document != null) { bool enabled = !string.IsNullOrEmpty(document.File); this.mnuOpenContainingFolder.Enabled = enabled; this.mnuCopyFullPath.Enabled = enabled; } }
private void MnuCopyFullPathClick(object sender, EventArgs e) { IDocumentForm document = this.GetDocument(); if (document != null) { string file = document.File; if (!string.IsNullOrEmpty(file)) { System.Windows.Forms.Clipboard.SetText(file, TextDataFormat.Text); } } }
private void MnuSaveAsClick(object sender, EventArgs e) { IDocumentForm document = this.GetDocument(); if (document != null) { try { document.SaveAs(); } catch (Exception ex) { Helper.Exceptions.Show(string.Format(Strings.FileErrorSave, document.GetTitle()), ex); } } }
private void MnuOpenContainingFolderClick(object sender, EventArgs e) { IDocumentForm document = this.GetDocument(); if (document != null) { string file = document.File; if (!string.IsNullOrEmpty(file)) { string directory = Path.GetDirectoryName(file); if (directory != null && Directory.Exists(directory)) { // open the folder in explorer Process.Start(directory); } } } }
/// <summary> /// 检查文档缺陷,并返回检查结果 /// </summary> /// <param name="documentForm">被检查缺陷的文档窗口</param> /// <returns>Common.SystemData.ReturnValue</returns> public short CheckDocumentBugs(IDocumentForm documentForm) { if (this.DocumentForm != documentForm) { this.DocumentForm = documentForm; } this.listView1.Items.Clear(); this.Update(); if (documentForm == null || documentForm.IsDisposed) { return(SystemData.ReturnValue.FAILED); } if (this.MainForm == null || this.MainForm.IsDisposed) { return(SystemData.ReturnValue.FAILED); } //获取病历文本数据 string szTextData = string.Empty; short shRet = SystemData.ReturnValue.OK; if (documentForm is HerenDocForm) { szTextData = (documentForm as HerenDocForm).TextEditor.Text; } else { documentForm.MedEditor.GetPureTextData(ref szTextData); } if (shRet != SystemData.ReturnValue.OK || GlobalMethods.Misc.IsEmptyString(szTextData)) { return(SystemData.ReturnValue.OK); } //初始化质控引擎 if (this.m_bugCheckEngine == null) { this.m_bugCheckEngine = new BugCheckEngine(); } this.m_bugCheckEngine.UserInfo = this.GetUserInfo(); this.m_bugCheckEngine.PatientInfo = this.GetPatientInfo(); this.m_bugCheckEngine.VisitInfo = this.GetVisitInfo(); this.m_bugCheckEngine.DocType = this.Text; this.m_bugCheckEngine.DocText = szTextData; //m_bugCheckEngine.SectionInfos = new List<DocumentSectionInfo>(); shRet = this.m_bugCheckEngine.InitializeEngine(); if (shRet != SystemData.ReturnValue.CANCEL && shRet != SystemData.ReturnValue.OK) { MessageBoxEx.Show("病历质控引擎初始化失败,无法对病历进行自动质控!"); return(SystemData.ReturnValue.OK); } //检查文档内容缺陷 List <DocuemntBugInfo> lstDocuemntBugList = null; if (shRet == SystemData.ReturnValue.OK) { lstDocuemntBugList = this.m_bugCheckEngine.PerformBugCheck(); this.m_bugCheckEngine.DocText = null; } //检查文档元素缺陷 List <ElementBugInfo> lstElementBugList = null; List <MedDocSys.PadWrapper.ElementBugInfo> bugs = new List <MedDocSys.PadWrapper.ElementBugInfo>(); if (documentForm is HerenDocForm) { (documentForm as HerenDocForm).CheckElementBugs(ref lstElementBugList); } else { documentForm.MedEditor.CheckElementBugs(ref bugs); foreach (var item in bugs) { ElementBugInfo bug = new ElementBugInfo(); bug.BugDesc = item.BugDesc; bug.ElementID = item.ElementID; bug.ElementName = item.ElementName; if (item.ElementType == MDSDBLib.ElementType.CheckBox) { bug.ElementType = ElementType.CheckBox; } else if (item.ElementType == MDSDBLib.ElementType.ComplexOption) { bug.ElementType = ElementType.ComplexOption; } else if (item.ElementType == MDSDBLib.ElementType.InputBox) { bug.ElementType = ElementType.InputBox; } else if (item.ElementType == MDSDBLib.ElementType.Outline) { bug.ElementType = ElementType.Outline; } else if (item.ElementType == MDSDBLib.ElementType.SimpleOption) { bug.ElementType = ElementType.SimpleOption; } bug.IsFatalBug = item.IsFatalBug; } } if ((lstDocuemntBugList == null || lstDocuemntBugList.Count <= 0) && (lstElementBugList == null || lstElementBugList.Count <= 0)) { MessageBoxEx.Show("系统已完成文档缺陷检查,没有检查到缺陷!", MessageBoxIcon.Information); //未检测到缺陷,则将窗口置后并最小化 if (this.DockPanel == null) { this.Owner = null; this.SendToBack(); this.WindowState = FormWindowState.Minimized; } return(SystemData.ReturnValue.OK); } this.RefreshBugsList(lstElementBugList, lstDocuemntBugList); return(SystemData.ReturnValue.OK); }
private void SetDocumentMenus(IDocumentForm document) { bool isDocument = document != null; bool isVisible; bool isEnabled; if (isDocument && this.systemEditorForm != null) { this.systemEditorForm.DataPath = document.DataPath; } this.SetMenuVisible(this.mnuSave, isDocument); this.SetMenuVisible(this.mnuSaveAs, isDocument); this.SetMenuVisible(this.mnuSaveAll, isDocument); this.SetMenuVisible(this.mnuSaveSeperator, isDocument); this.SetMenuVisible(this.mnuWindowsSeperator, isDocument); this.SetMenuVisible(this.mnuClose, isDocument); this.mnuCloseAllDocuments.Enabled = isDocument; isVisible = isDocument && document.CanSave(); this.SetMenuVisible(this.mnuSave, isVisible); this.SetMenuVisible(this.mnuSaveAs, isVisible); if (isVisible) { string title = document.GetTitle(); this.mnuSave.Text = string.Format(Strings.FileEditorSave, title); this.mnuSaveAs.Text = string.Format(Strings.FileEditorSaveAs, title); } this.mnuUndo.Enabled = isDocument && document.CanUndo(); this.mnuRedo.Enabled = isDocument && document.CanRedo(); this.mnuCopy.Enabled = isDocument && document.ObjectSelected(); this.mnuCut.Enabled = isDocument && document.ObjectSelected(); this.mnuPaste.Enabled = isDocument && document.CanPaste(); this.mnuAdd.Enabled = isDocument && document.CanAdd(); this.mnuAdd.DropDown = isDocument ? document.MultipleAddDropDown() : null; this.mnuSelectAll.Enabled = isDocument && document.CanSelectAll(); this.mnu3dEditor.Enabled = isDocument && document.CanDisplay3DViewer(); isVisible = isDocument && document.CanFocusSelected(false); isEnabled = isVisible && document.CanFocusSelected(true); this.SetMenuVisible(this.mnuFocusSelected, isVisible, isEnabled); this.SetMenuVisible(this.mnuLookAtSelected, isVisible, isEnabled); this.SetMenuVisible(this.mnuFocusSelectedSeperator, isVisible); isVisible = isDocument && document.CanTrackSelected(false); isEnabled = isVisible && document.CanTrackSelected(true); this.SetMenuVisible(this.mnuTrackSelected, isVisible, isEnabled); isVisible = isDocument && document.CanManipulatePosition(); isEnabled = isVisible && document.CanManipulateRotationScale(); this.SetMenuVisible(this.mnuManipulationNone, isVisible); this.SetMenuVisible(this.mnuManipulationTranslate, isVisible); this.SetMenuVisible(this.mnuManipulationRotate, isVisible, isEnabled); this.SetMenuVisible(this.mnuManipulationScale, isVisible, isEnabled); this.SetMenuVisible(this.mnuManipulationSeperator, isVisible); isVisible = isDocument && document.CanChangeVisibility(false); isEnabled = isVisible && document.CanChangeVisibility(true); this.SetMenuVisible(this.mnuChangeVisibility, isVisible, isEnabled); this.SetMenuVisible(this.mnuShowModels, isVisible); this.SetMenuVisible(this.mnuShowModelsSeperator, isVisible); }
private void MnuChangeVisibilityClick(object sender, EventArgs e) { IDocumentForm content = this.GetDocument(); content?.ChangeVisibility(); }
private void MnuPasteClick(object sender, EventArgs e) { IDocumentForm document = this.GetDocument(); document?.Paste(); }
private void OnDocumentChanged(IDocumentForm document) => this.DocumentChanged?.Invoke(document);
private void MnuCopyClick(object sender, EventArgs e) { IDocumentForm document = this.GetDocument(); document?.Copy(); }
protected override void OnPatientInfoChanged() { this.DocumentForm = null; }
private void MnuRedoClick(object sender, EventArgs e) { IDocumentForm document = this.GetDocument(); document?.Redo(); }
private void MnuSelectAllClick(object sender, EventArgs e) { IDocumentForm document = this.GetDocument(); document?.SelectAll(); }