/// <summary> /// fetch height of right panel into control inside /// </summary> private void SetHeightForProntoDocMarkup() { TemplateInfo templateInfo = this.TemplateInfo; if (templateInfo.RightPanel != null) { ProntoDocMarkup proMarkupCtrl = templateInfo.RightPanel.Control as ProntoDocMarkup; proMarkupCtrl.SetHeightControl(templateInfo.RightPanel.Height); } }
/// <summary> /// add right panel into document /// </summary> public void AddProntoTaskPane() { try { TemplateInfo templateInfo = this.TemplateInfo; if (templateInfo.RightPanel != null) { CustomTaskPanes.Add(templateInfo.RightPanel.Control, Properties.Resources.ipm_RibbonTitle); } else { ProntoDocMarkup proMarkupCtrl = new ProntoDocMarkup(); // backup width before add int parentWidth = proMarkupCtrl.cboDomain.Parent.Width; int width = proMarkupCtrl.cboDomain.Width; // add to right panel of document templateInfo.RightPanel = CustomTaskPanes.Add(proMarkupCtrl, Properties.Resources.ipm_RibbonTitle); // after add, the width of domain control is reset to 0 then we need restore its. proMarkupCtrl.cboDomain.Parent.Width = parentWidth; proMarkupCtrl.cboDomain.Width = width; templateInfo.RightPanel.Width = 252; templateInfo.RightPanel.Visible = true; templateInfo.RightPanel.VisibleChanged += new EventHandler(ProntoTaskPane_VisibleChanged); if (ActiveDocument != null) { AddOrderContextMenu(); } } SetHeightForProntoDocMarkup(); } catch (BaseException srvExp) { ManagerException mgrExp = new ManagerException(ErrorCode.ipe_LoadResourceError); mgrExp.Errors.Add(srvExp); LogUtils.LogManagerError(mgrExp); } }
/// <summary> /// Occurs when the selection changes in the active document window. (Inherited from ApplicationEvents4_Event.) /// When user change selection in word document /// </summary> /// <param name="Sel"></param> private void Application_WindowSelectionChange(Word.Selection Sel) { TemplateInfo template = this.TemplateInfo; if (template.IsProntoDoc) { DataIntegrationManager bmMgr = new DataIntegrationManager(); string bmName = bmMgr.HasBookmark(Sel); if (bmMgr.GetForeachTag(Sel) != null) { BaseManager.ChangeOrderByStatus(true); } else { BaseManager.ChangeOrderByStatus(false); } #region update full map TemplateInfo templateInfo = this.TemplateInfo; if (templateInfo.RightPanel != null) { ProntoDocMarkup proMarkupCtrl = templateInfo.RightPanel.Control as ProntoDocMarkup; if (string.IsNullOrEmpty(bmName)) { proMarkupCtrl.UpdateFullMap(null); } else { InternalBookmarkItem iBm = TemplateInfo.InternalBookmark.GetInternalBookmarkItem(bmName); proMarkupCtrl.UpdateFullMap(iBm); } } #endregion } else { BaseManager.ChangeOrderByStatus(false); } }