Esempio n. 1
0
 public override void OnWorkbookActivate(Excel.Workbook Wb)
 {
     try{
         if (Wb == null)
         {
             return;
         }
         _tabVisible = false;
         if (_commandList.ContainsKey(Wb))
         {
             _commands   = _commandList[Wb];
             _tabVisible = true;
         }
         else if (IsTemplateWb(Wb))
         {
             _commands             = new WorkbookInstance(_excelapp, Wb);
             _commands.OnLogInOut += OnLogInOut;
             Wb.BeforeClose       += _commands.OnWorkbookClose;
             Wb.BeforeClose       += OnWorkbookClose;
             _commandList.Add(Wb, _commands);
             _tabVisible = true;
         }
         if (_ribbon != null)
         {
             _ribbon.Invalidate();
         }
     } catch (Exception ex) { new BusinessObjectsUtils.FrmException(_excelapp.Hwnd, ex).ShowDialog(); }
 }
Esempio n. 2
0
 public void RefreshCombobox()
 {
     try
     {
         if (ErrorHandler.IsValidListObject())
         {
             ribbon.Invalidate();
         }
     }
     catch (Exception ex)
     {
         ErrorHandler.DisplayMessage(ex);
     }
 }
Esempio n. 3
0
 private void InvalidateRibbon()
 {
     if (ribbon != null)
     {
         ribbon.Invalidate();
     }
 }
Esempio n. 4
0
        /// <summary>
        /// The NewInspector event fires whenever a new Inspector is displayed.
        /// </summary>
        /// <param name="Explorer"></param>
        void m_Inspectors_NewInspector(Microsoft.Office.Interop.Outlook.Inspector Inspector)
        {
            m_Ribbon.Invalidate();

            try
            {
                // Check to see if this is a new window
                // we don't already track
                OutlookInspector existingWindow = FindOutlookInspector(Inspector);
                // If the m_InspectorWindows collection does not
                // have a window for this Inspector,
                // we should add it to m_InspectorWindows
                if (existingWindow == null)
                {
                    OutlookInspector window = new OutlookInspector(Inspector);
                    window.Close             += new EventHandler(WrappedInspectorWindow_Close);
                    window.InvalidateControl += new EventHandler <OutlookInspector.InvalidateEventArgs>(WrappedInspectorWindow_InvalidateControl);
                    m_InspectorWindows.Add(window);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }
        }
Esempio n. 5
0
        public void btnTableConfigure_Click(Microsoft.Office.Core.IRibbonControl control)
        {
            FormTableOption formTableOption = new FormTableOption();

            formTableOption.ShowDialog();
            ribbon.Invalidate();
        }
Esempio n. 6
0
 public void UpdateRibbon()
 {
     if (_ribbon != null)
     {
         _ribbon.Invalidate();
     }
 }
Esempio n. 7
0
 public void Invalidate()
 {
     if (ribbonThis != null)
     {
         ribbonThis.Invalidate();
     }
 }
Esempio n. 8
0
        /// <summary>
        /// After State
        /// </summary>
        /// <param name="isConnected"></param>
        private void AfterState(bool isConnected)
        {
            if (isConnected)
            {
                PopulateProjectCollection();
                PopulateLinkEnds();
                PopulateProjects();
                PopulateAreas();
                btnConnectLabel  = Properties.Resources.btnDisconnectLabel;
                menuTfsUserLabel = tfsManager.GetUserDisplayName();
                StoreConnectionUrl();
            }
            else
            {
                // TODO:
                projects.Clear();
                projects.Add(0, string.Empty);
                projectsCount        = 0;
                projectSelectedIndex = 0;
                links.Clear();
                links.Add(0, string.Empty);
                linksCount        = 0;
                linkSelectedIndex = 0;
                areas.Clear();
                areas.Add(0, string.Empty);
                areasCount           = 0;
                areaSelectedIndex    = 0;
                addIn.LinkWorkItemId = LinkWorkItemID = 0;
                LinkWorkItemTextInfo = "";
                projectCollection.Clear();
                projectCollection.Add(0, string.Empty);
                projectCollectionCount         = 0;
                projectCollectionSelectedIndex = 0;
                btnConnectLabel  = Properties.Resources.btnConnectLabel;
                menuTfsUserLabel = Properties.Resources.lblTextNotLoggedIn;
            }

            cbxConnectionUrlIsEnabled     = !isConnected;
            ddlProjectCollectionIsEnabled = isConnected;
            ddlProjectsIsEnabled          = isConnected;
            edbLinkWiIDIsEnabled          = isConnected;
            ddlAreasIsEnabled             = isConnected;
            ddlLinksIsEnabled             = isConnected;

            btnUpdateIsEnabled        = isConnected;
            btnUpdateAndSyncIsEnabled = isConnected;
            btnExportItemIsEnabled    = false;
            btnImportItemsIsEnabled   = isConnected;
            mnuTfsUserIsEnabled       = isConnected;
            btnNewWorkItemIsEnabled   = false;
            btnOpenWorkItemIsEnabled  = false;
            btnAddDetailsIsEnabled    = false;
            btnLinkItemsIsEnabled     = false;
            btnObsoleteItemIsEnabled  = false;
            btnMatrixIsEnabled        = isConnected;
            btnReportIsEnabled        = isConnected;

            ribbon.Invalidate();
        }
Esempio n. 9
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="control"></param>
        /// <param name="pressed"></param>
        public void OnAction_Checkbox(Office.IRibbonControl control, bool pressed)
        {
            try
            {
                switch (control.Id)
                {
                case "chkBackstageMarkup":
                    //Properties.Settings.Default.Visible_mnuScriptType_Markup = pressed;
                    break;
                }

                ribbon.Invalidate();
            }
            catch (Exception)
            {
                //ErrorHandler.DisplayMessage(ex);
            }
        }
Esempio n. 10
0
 internal void InvalidateCommand(CommandElement command, bool forceUpdate)
 {
     _officeUI?.InvalidateControl(command.Id);
     if (forceUpdate)
     {
         _officeUI?.Invalidate();
         // TODO: sometimes if the focus is on another window, it is not updated.
     }
 }
Esempio n. 11
0
        private void SetAddInUsability(bool enable)
        {
            AddInEnabled = enable;
            if (!AddInEnabled)
            {
                SetTaskPaneVisibility(false);
            }

            _ribbon.Invalidate();
        }
        public void OnConfigDialog(Office.IRibbonControl control)
        {
            ConfigDialogControl configDialog = new ConfigDialogControl();

            // Makes the dialog open centered on the screen that Outlook is using.
            configDialog.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
            // .ShowDialog makes it modal, .Show makes it a regular window - which could get lost.
            configDialog.ShowDialog();

            ribbon.Invalidate();
        }
Esempio n. 13
0
 public void Invalidate()
 {
     try {
         if (ribbon.IsNotNullOrMissing())
         {
             ribbon.Invalidate();
             ribbon.InvalidateControl("TabShare");
         }
     }
     catch { }
 }
Esempio n. 14
0
 public void ShapeResize(PowerPoint.Shape shp)
 {
     if (LockContraints && SlideScanner.Instance.LastScan != null)
     {
         float newWidth  = shp.Width;
         float newHeight = shp.Height;
         var   LastScan  = SlideScanner.Instance.LastScan;
         var   prevWKey  = SnapDetector.Instance.FloatToKey(LastScan[shp.Id].Width);
         var   prevHKey  = SnapDetector.Instance.FloatToKey(LastScan[shp.Id].Height);
         var   currWKey  = SnapDetector.Instance.FloatToKey(shp.Width);
         var   currHKey  = SnapDetector.Instance.FloatToKey(shp.Height);
         shp.Width  = LastScan[shp.Id].Width;
         shp.Height = LastScan[shp.Id].Height;
         Application.StartNewUndoEntry();
         if (prevWKey != currWKey)
         {
             SnapDetector.Instance.SetShapeWidth(SlideScanner.Instance.ScanSlide(SlideSelection[1]), shp.Id, newWidth);
         }
         else
         {
             SnapDetector.Instance.SetShapeHeight(SlideScanner.Instance.ScanSlide(SlideSelection[1]), shp.Id, newHeight);
         }
         LockContraints = false;
         SlideScanner.Instance.ScanSlide(SlideSelection[1]);
         Ribbon.Invalidate();
     }
     else if (LockContraints)
     {
         LockContraints = false;
         Ribbon.Invalidate();
     }
     else
     {
         if (SlideSelection == null || SlideSelection.Count != 1)
         {
             return;
         }
         FlashSketch.Instance.Application.StartNewUndoEntry();
         SnapDetector.Instance.UpdateSnapCache(SlideScanner.Instance.ScanSlide(SlideSelection[1]));
     }
 }
 /// <summary>Handles the folder switch event of an explorer.</summary>
 void explorer_FolderSwitch()
 {
     //Set the Search string
     if (ribbon.SearchText != null && ribbon.SearchText != string.Empty)
     {
         ribbon.SearchText = string.Empty;
         if (ribbonUI != null)
         {
             ribbonUI.Invalidate();
         }
     }
 }
Esempio n. 16
0
        private static void OutlookEvent__Inspectors_NewInspector(Outlook.Inspector inspector)
        {
            Ribbon.Invalidate();

            // Check to see if this is a new window we don't already track
            var existingInspector = FindOutlookInspector(inspector);

            // If the collection has a window for this Inspector then return, otherwise we should add it
            if (existingInspector != null)
            {
                return;
            }

            var window = new OutlookInspector(inspector);

            window.Close             += WrappedInspectorWindow_Close;
            window.InvalidateControl += WrappedInspectorWindow_InvalidateControl;
            InspectorWindows.Add(window);
        }
Esempio n. 17
0
        public void OnLogin(Office.IRibbonControl control)
        {
            if (isLoggedIn)
            {
                // disconnect
                RestConnector.GetInstance().Disconnect();

                isLoggedIn = false;
            }
            else
            {
                // connect
                SettingsForm form         = new SettingsForm();
                var          config       = persistService.Load <LoginConfiguration>();
                var          calendarName = config.CalendarName;
                form.Configuration = config;

                if (form.ShowDialog() == DialogResult.OK)
                {
                    loginConfig = form.Configuration;
                    loginConfig.CalendarName = calendarName;

                    //save last successful configuration
                    persistService.Save(loginConfig);
                    NgaUtils.init(loginConfig.SharedSpaceId, loginConfig.WorkspaceId, loginConfig.ReleaseId);
                    isLoggedIn = true;

                    // select the calendar tab
                    OutlookUtils.SelectCalenderTab();
                }
            }
            if (ribbon != null)
            {
                ribbon.Invalidate();
            }
        }
Esempio n. 18
0
        public void OnLogin(Office.IRibbonControl control)
        {
            if (isLoggedIn)
            {
                // disconnect
                SettingsForm.RestConnector.Disconnect();

                isLoggedIn = false;
            }
            else
            {
                // connect
                SettingsForm form         = new SettingsForm();
                String       calendarName = null;
                if (config != null)
                {
                    calendarName = config.CalendarName;
                }
                form.Configuration = config;
                if (form.ShowDialog() == DialogResult.OK)
                {
                    config = form.Configuration;
                    config.CalendarName = calendarName;

                    NgaUtils.init(config.SharedSpaceId, config.WorkspaceId, config.ReleaseId);
                    isLoggedIn = true;

                    // select the calendar tab
                    OutlookUtils.SelectCalenderModule();
                }
            }
            if (ribbon != null)
            {
                ribbon.Invalidate();
            }
        }
Esempio n. 19
0
 /// <summary>
 /// This method is triggered after the sheet selection change event
 /// </summary>
 /// <param name="sh">the name of the sheet </param>
 /// <param name="target">the currently selected range </param>
 /// <remarks></remarks>
 private void e_Application_SheetSelectionChange(object sh, Excel.Range target)
 {
     e_ribbon.Invalidate();
 }
Esempio n. 20
0
 public void Invalidate()
 {
     _ribbon.Invalidate();
 }
Esempio n. 21
0
 public void Ribbon_Load(Office.IRibbonUI ribbonUI)
 {
     this.ribbon = ribbonUI;
     ribbon.Invalidate();
 }
Esempio n. 22
0
 public void InvalidateRibbon()
 {
     ribbon.Invalidate();
 }
Esempio n. 23
0
 /// <summary>
 /// when user close panel (is fired on from ThisAddIn)
 /// </summary>
 private void uiService_DisableRibbon()
 {
     IsEnableBookmarkButton = true;
     ribbon.Invalidate();
 }
Esempio n. 24
0
 public void SetearPermiso(bool isEnabled, string id)
 {
     _listaBools[id] = isEnabled;
     _ribbon.Invalidate();
 }
Esempio n. 25
0
 private void ThisAddIn_NewWorkbook(Excel.Workbook Wb)
 {
     ribbon.Invalidate();
 }
Esempio n. 26
0
        public Bitmap setImage(Office.IRibbonControl rib)
        {
            switch (rib.Id)
            {
            case "customButton13": return(new Bitmap(PPTAttribute.PiCon + "Title  Slide.png"));

            case "customButton14": return(new Bitmap(PPTAttribute.PiCon + "Content Slide.png"));

            case "customButton15": return(new Bitmap(PPTAttribute.PiCon + "Section Heading.png"));

            case "customButton16": return(new Bitmap(PPTAttribute.PiCon + "Framework Slide.png"));

            case "customButton17": return(new Bitmap(PPTAttribute.PiCon + "Blank Slide.png"));

            case "customButton18": return(new Bitmap(PPTAttribute.PiCon + "Title  Slide.png"));

            case "customButton21": return(new Bitmap(PPTAttribute.PiCon + "Slide Title.png"));

            case "customButton22": return(new Bitmap(PPTAttribute.PiCon + "Slide Title.png"));

            case "customButton23": return(new Bitmap(PPTAttribute.PiCon + "Text Box.png"));

            case "customButton24": return(new Bitmap(PPTAttribute.PiCon + "Note Box.png"));

            case "customButton25": return(new Bitmap(PPTAttribute.PiCon + "Source Box.png"));

            case "customButton26": return(new Bitmap(PPTAttribute.PiCon + "Chart Title.png"));

            case "customButton27": return(new Bitmap(PPTAttribute.PiCon + "Quote Box.png"));

            case "customButton31": return(new Bitmap(PPTAttribute.PiCon + "Slide Title.png"));

            case "customButton32": return(new Bitmap(PPTAttribute.PiCon + "Slide Title.png"));

            case "customButton33": return(new Bitmap(PPTAttribute.PiCon + "Text Box.png"));

            case "customButton34": return(new Bitmap(PPTAttribute.PiCon + "Note Box.png"));

            case "customButton35": return(new Bitmap(PPTAttribute.PiCon + "Source Box.png"));

            case "customButton36": return(new Bitmap(PPTAttribute.PiCon + "Chart Title.png"));

            case "customButton37": return(new Bitmap(PPTAttribute.PiCon + "Quote Box.png"));

            case "customButton41": return(new Bitmap(PPTAttribute.PiCon + "Column chart.png"));

            case "customButton42": return(new Bitmap(PPTAttribute.PiCon + "Stacked Chart.png"));

            case "customButton44": return(new Bitmap(PPTAttribute.PiCon + "Pie chart.png"));

            case "customButton11": return(new Bitmap(PPTAttribute.PiCon + "New Theme1.png"));

            case "customButton28": return(new Bitmap(PPTAttribute.PiCon + "Slide Title.png"));

            case "btnbullet1": return(new Bitmap(PPTAttribute.PiCon + "bullet1.png"));

            case "btnbullet2": return(new Bitmap(PPTAttribute.PiCon + "bullet2.png"));

            case "btnbullet3": return(new Bitmap(PPTAttribute.PiCon + "bullet3.png"));

            case "btnformatPPT": return(new Bitmap(PPTAttribute.PiCon + "New Theme1.png"));

            case "galTest": return(new Bitmap(PPTAttribute.PiCon + "color scheme.png"));

            case "btnAlignCenter": return(new Bitmap(PPTAttribute.PiCon + "VerticalCenter.png"));

            case "menu41": return(new Bitmap(PPTAttribute.PiCon + "InsertChart.png"));

            case "menu11": return(new Bitmap(PPTAttribute.PiCon + "Add slide1.png"));

            case "menuRemove": return(new Bitmap(PPTAttribute.PiCon + "IconClean.png"));

            case "btnRemoveDoubleSpace": return(new Bitmap(PPTAttribute.PiCon + "IconRDspace.png"));
            }
            ribbon.Invalidate();
            return(null);
        }
 /// <summary>
 /// The NewInspector event fires whenever a new Inspector is displayed.
 /// Need to mark custom button for update, by running the getVisible callback before a Read inspector appears.
 /// </summary>
 /// <param name="Inspector"></param>
 void m_Inspectors_NewInspector(Outlook.Inspector Inspector)
 {
     m_Ribbon.Invalidate();
 }
Esempio n. 28
0
 public void UpdateRibbon()
 {
     _ribbon.Invalidate();
 }
Esempio n. 29
0
 public static void Invalidate() => ribbon.Invalidate();