示例#1
0
文件: Ribbon2.cs 项目: leonchen09/poc
        private void initPanel()
        {
            if (RightPanel != null)
            {
                return;
            }
            CustomTaskPaneCollection CustomTaskPanes = Globals.Factory.CreateCustomTaskPaneCollection(null, null, "CustomTaskPanes", "CustomTaskPanes", this);

            proMarkupCtrl = new ProntoExcelMarkup();
            proMarkupCtrl.tabControl1.SelectedIndex = 0;

            RightPanel       = CustomTaskPanes.Add(proMarkupCtrl, "Pronto Excel");
            RightPanel.Width = 252;

            //update exported tree
            foreach (ExportItemMap item in export.exportItems)
            {
                TreeNode node = proMarkupCtrl.treeView2.Nodes[0].Nodes.Add(item.treeNodeName);
                if (item.mapType == ProntoDoc.Framework.CoreObject.MapType.Table)
                {
                    foreach (TableColumnMap col in item.tabCols)
                    {
                        node.Nodes.Add(col.treeNodeName);
                    }
                }
            }
        }
示例#2
0
        public static void RemoveTaskPane(CustomTaskPane taskPane, CustomTaskPaneCollection customTaskPanes)
        {
            //PLLog.Trace3("Enter", System.Data.Common.PROJECT_NAME);

            customTaskPanes.Remove(taskPane);

            //PLLog.Trace3("Exit", System.Data.Common.PROJECT_NAME);
        }
示例#3
0
 /// <summary>
 /// 获取Word应用程序对象
 /// </summary>
 /// <returns></returns>
 private CustomTaskPaneCollection GetPanes()
 {
     if (_customTaskPanes == null)
     {
         _customTaskPanes = this._context.GetService <CustomTaskPaneCollection>(_customTaskPaneReference);
     }
     return(_customTaskPanes);
 }
示例#4
0
 public ApplicationBootstrapper(OutlookInterop.Application application, CustomTaskPaneCollection customTaskPaneCollection,
                                RibbonCollectionBase thisRibbonCollection, FormRegionCollectionBase thisFormRegionCollection, MainAddInRibbon mainRibbon)
 {
     this.application = application;
     this.customTaskPaneCollection = customTaskPaneCollection;
     this.thisRibbonCollection     = thisRibbonCollection;
     this.thisFormRegionCollection = thisFormRegionCollection;
     this.mainRibbon = mainRibbon;
 }
示例#5
0
        /// <summary>
        /// Creates an instance of the class
        /// </summary>
        public COMAddin()
        {
            Factory = RaiseCreateFactory();
            if (null == Factory)
                Factory = Core.Default;
            TaskPanes = new CustomTaskPaneCollection();
			TaskPaneInstances = new List<ITaskPane>();
            Type = this.GetType();
        }
示例#6
0
文件: Ribbon1.cs 项目: leonchen09/poc
        private void button1_Click(object sender, RibbonControlEventArgs e)
        {
            CustomTaskPaneCollection CustomTaskPanes = Globals.Factory.CreateCustomTaskPaneCollection(null, null, "CustomTaskPanes", "CustomTaskPanes", this);
            ProntoExcelMarkup        proMarkupCtrl   = new ProntoExcelMarkup();
            CustomTaskPane           RightPanel      = CustomTaskPanes.Add(proMarkupCtrl, "ProntoExcel");

            RightPanel.Width   = 252;
            RightPanel.Visible = true;
        }
示例#7
0
        public Host(Application application, CustomTaskPaneCollection customTaskPanes, ApplicationFactory applicationFactory)
        {
            this.Application        = application;
            this.CustomTaskPanes    = customTaskPanes;
            this.ApplicationFactory = applicationFactory;

            this.VstoWorksheetByInteropWorksheet = new Dictionary <Microsoft.Office.Interop.Excel.Worksheet, Worksheet>();
            this.VstoWorkbookByInteropWorkbook   = new Dictionary <Microsoft.Office.Interop.Excel.Workbook, Workbook>();
        }
示例#8
0
文件: Ribbon1.cs 项目: leonchen09/poc
 public void btnStartPronto_Click(Office.IRibbonControl control)
 {
     if (customTaskPane == null)
     {
         CustomTaskPaneCollection CustomTaskPanes = Globals.Factory.CreateCustomTaskPaneCollection(null, null, "CustomTaskPanes", "CustomTaskPanes", this);
         customTaskPane       = CustomTaskPanes.Add(new CustomTaskPaneControl(), "Pronto Mobile");
         customTaskPane.Width = 252;
     }
     customTaskPane.Visible = true;
 }
示例#9
0
 /// <summary>
 /// Creates an instance of the class
 /// </summary>
 public COMAddin()
 {
     _factory = RaiseCreateFactory();
     if (null == _factory)
     {
         _factory = Core.Default;
     }
     TaskPanes         = new CustomTaskPaneCollection();
     TaskPaneInstances = new List <ITaskPane>();
 }
示例#10
0
        private ConfigPane(Object inWin, Object inDoc, CustomTaskPaneCollection inCustomTaskPanes, string version)
        {
            const int OrigWidth = 363;

            logger.ConditionalDebug("ConfigPane");
            theWin               = inWin;
            theDoc               = inDoc;
            customTaskPanes      = inCustomTaskPanes;
            confContr            = new ConfigControl(inWin, inDoc, version);
            configTaskPane       = customTaskPanes.Add(confContr, ConfigBase.ColorizationName, theWin);
            configTaskPane.Width = ((int)(OrigWidth * confContr.ScaleFactor)) + 2;
        }
示例#11
0
        /// <summary>
        /// Creates an instance of the class
        /// </summary>
        public COMAddin()
        {
            try
            {
                TaskPanes = new CustomTaskPaneCollection();
				TaskPaneInstances = new List<ITaskPane>();
                Type = this.GetType();
            }
            catch (System.Exception exception)
            {
				NetOffice.DebugConsole.WriteException(exception);
                bool handled = false;
                RaiseErrorHandlerMethod(exception, ref handled);
                if(!handled)
                    throw exception;
            }
        }
示例#12
0
        /// <summary>
        /// Opens the ConfigPane for the given Window.
        /// </summary>
        /// <param name="theWin">The window the ConfigPane is attached to</param>
        /// <param name="theDoc">The document (or presentation in PPT) that is opened in <c>theWin</c></param>
        /// <param name="inCustomTaskPanes">The <c>CustomTaskPaneCOllection the ConfigPane should be added to.</c></param>
        /// <param name="version">The version of the software as should be displayed in the pannel </param>
        /// <remarks>We assume that there can be several windows for the same document</remarks>
        public static void MakePaneVisibleInWin(Object theWin, Object theDoc, CustomTaskPaneCollection inCustomTaskPanes,
                                                string version)
        {
            logger.ConditionalDebug("MakePaneVisibleInWin");
            ConfigPane theCP;

            if (!confTaskPanes.TryGetValue(theWin, out theCP))
            {
                theCP = new ConfigPane(theWin, theDoc, inCustomTaskPanes, version);
                confTaskPanes.Add(theWin, theCP);
            }
            else
            {
                theCP.confContr.UpdateAll();
                // formellement, ceci n'est pas nécessaire. Néanmoins, ça donne un peu de robustesse. Si l'utilisateur constate
                // qqch de bizarre, il peut fermer et réouvrir le panneau qui se remettra à jour.
            }

            theCP.configTaskPane.Visible = true;
        }
示例#13
0
        protected override void OnButtonAction(XRibbonButton xRibbonButton, RibbonEventArgs e)
        {
            Log.Debug("---VersionCommand--Begin:" + DateTime.Now.ToLongTimeString());
            CustomTaskPaneCollection panes = SceneContext.Instance.CustomTaskPanesAdmin.CustomTaskPanes;
            int panesCount = panes.Count;

            Log.Debug("---VersionCommand--01:" + DateTime.Now.ToLongTimeString());
            if (panesCount == 0)
            {
                var pane = new CustomPane();
                Log.Debug("---VersionCommand--02:" + DateTime.Now.ToLongTimeString());
                var host = new PaneDecorator(pane);
                Log.Debug("---VersionCommand--03:" + DateTime.Now.ToLongTimeString());
                panes.Add(host, "版本信息");
                Log.Debug("---VersionCommand--04:" + DateTime.Now.ToLongTimeString());
            }
            CustomTaskPane taskPane = panes[0];

            taskPane.VisibleChanged += new EventHandler(taskPane_VisibleChanged);
            taskPane.Width           = 430;
            taskPane.Visible         = true;
        }
 public static void InitAppTaskPanes(ref CustomTaskPaneCollection value)
 {
     m_taskPanes = new TaskPanes(ref value);
 }
示例#15
0
 /// <summary>
 /// Creates an instance of the class
 /// </summary>
 public COMAddin()
 {
     TaskPanes         = new CustomTaskPaneCollection();
     TaskPaneInstances = new List <ITaskPane>();
     Type = this.GetType();
 }
 public TaskPanes(ref CustomTaskPaneCollection taskPanes)
 {
     m_tpc = taskPanes;
 }
示例#17
0
 private void InitializeControls()
 {
     this.CustomTaskPanes = Globals.Factory.CreateCustomTaskPaneCollection(null, null, "CustomTaskPanes", "CustomTaskPanes", this);
     this.VstoSmartTags   = Globals.Factory.CreateSmartTagCollection(null, null, "VstoSmartTags", "VstoSmartTags", this);
 }
示例#18
0
 public AddInManager(Application application, CustomTaskPaneCollection customTaskPanes, ApplicationFactory factory)
 {
     this.application     = application;
     this.customTaskPanes = customTaskPanes;
     this.factory         = factory;
 }
示例#19
0
        public static Microsoft.Office.Tools.CustomTaskPane AddTaskPane(System.Windows.Forms.UserControl taskPane, string name, CustomTaskPaneCollection customTaskPanes)
        {
            //PLLog.Trace3("Enter", Common.PROJECT_NAME);

            CustomTaskPane ctp = default(CustomTaskPane);

            ctp = customTaskPanes.Add(taskPane, name);
            ctp.DockPosition = Microsoft.Office.Core.MsoCTPDockPosition.msoCTPDockPositionRight;
            ctp.Visible      = true;

            //PLLog.Trace3("Exit", System.Data.Common.PROJECT_NAME);
            return(ctp);
        }
示例#20
0
        public void AddProtectTaskPanes(WsInspector inspector, bool hookSendButton = true, bool visible = false)
        {
            try
            {
                var hook = new InspectorHook(inspector);
                WaitForItemSend(hook);

                _customTaskPanes = Globals.ThisAddin.GetCustomTaskPaneCollection();

                var alertBar = AddAlertTaskPane(_customTaskPanes, inspector);

                var ctp = new ProtectTaskPane(inspector, (AlertBarControl)alertBar.Control, OnStatusUpdate)
                {
                    Dock
                        =
                        DockStyle
                        .Fill
                };

                ctp.InspectorHook = hook;

                CustomTaskPane taskPane = _customTaskPanes.Add(ctp, "Workshare Protect",
                                                                inspector.UnSafeInspector);
                taskPane.Visible = visible;
                taskPane.Width = Utils.AdjustDimensionWithDpiHook(350);
                taskPane.VisibleChanged += TaskPaneVisibleChanged;
                taskPane.DockPositionChanged += OnDockPositionChanged;
                taskPane.DockPosition = (MsoCTPDockPosition)OptionApi.GetInt("InteractiveProtectDockPosition");

                if (_protectTaskPanes.TryAdd(inspector.Id, taskPane) && hookSendButton)
                {
                    hook.ActionQueueController = ctp.Presenter.ActionQueueController;
                    ctp.InitializeMailItemWithAttachments();
                }

            }
            catch (Exception e)
            {
                Logger.LogError(e);                
                throw;
            }
        }
示例#21
0
        public void Remove(Guid id, bool savedToDrafts)
        {
            _customTaskPanes = Globals.ThisAddin.GetCustomTaskPaneCollection();

            if (_alertTaskPanes.ContainsKey(id))
            {
                _customTaskPanes.Remove(_alertTaskPanes[id]);
                CustomTaskPane ctp;
                _alertTaskPanes.TryRemove(id, out ctp);
            }

            RibbonButton button;
            if (_protectFilesButtons.TryRemove(id, out button))
            {
                button.Click -= OnProtectFilesClick;
            }

            if (!savedToDrafts)
                RemoveSendLinkFolderIfTheMailWasNeverSent(id);

            RemoveTaskPane(id);
        }
示例#22
0
        private CustomTaskPane AddAlertTaskPane(CustomTaskPaneCollection customTaskPanes, WsInspector inspector)
        {
            if (_alertTaskPanes.ContainsKey(inspector.Id))
                return _alertTaskPanes[inspector.Id];

            var alertUserControl = new AlertBarControl(inspector) { Visible = true };
            alertUserControl.ShowAlertBar += OnShowAlertBar;
            alertUserControl.AlertBarClicked += OnAlertBarClicked;
            var alertTaskPane = customTaskPanes.Add(alertUserControl, " ", inspector.UnSafeInspector);
            alertUserControl.TaskPane = alertTaskPane;
            alertTaskPane.DockPosition = MsoCTPDockPosition.msoCTPDockPositionTop;
            alertTaskPane.Height = Utils.AdjustDimensionWithDpiHook(55);
            alertTaskPane.Visible = false;
            _alertTaskPanes.TryAdd(inspector.Id, alertTaskPane);
            return alertTaskPane;
        }