Exemple #1
0
        public void OnLogonButtonPressed(IRibbonControl control)
        {
            string clusterUrl = "";
            int itemIndx = 0;

            switch (control.Id)
            {
                case "LogonButton1":
                    clusterUrl = "https://dev.ufora.com:443";
                    itemIndx = 1;
                    break;
                case "LogonButton2":
                    clusterUrl = "https://demo.ufora.com:443";
                    itemIndx = 2;
                    break;
                case "LogonButton3":
                    clusterUrl = "https://stable.ufora.com:443";
                    itemIndx = 3;
                    break;
                default:
                    clusterUrl = "";
                    break;
            }
            if (clusterUrl != "")
            {
                ClusterLogonForm logonForm = new ClusterLogonForm(clusterUrl, itemIndx);
                logonForm.Show();
            }
            else
                MessageBox.Show("undefined url");
        }
        public void BuildEquityAnalysisModel(IRibbonControl control)
        {
            MessageDialog x = new MessageDialog("Building Model...", Constants.AddInName);
            x.DoAction(
                (dialog) =>
                {
                    TaskEx.Delay(0).Then((t) =>
                    {
                        string ticker = (string)ExcelUtil.Worksheet("Main").Range("Symbol").Value;
                        FinanceDataLoader.BuildEquityAnalysis(ticker).Then(
                            result =>
                            {
                                dialog.SetMessage("Done!");
                                dialog.Resume();
                            }
                        ).Finally(
                            e =>
                            {
                                dialog.SetMessage("Error occurred" + e.Message);
                            }
                        );

                    });
                }
            );
        }
Exemple #3
0
 public Image GetImage(IRibbonControl control)
 {
     switch (control.Id)
     {
         case "WorkshareSaveAsRecentFoldersBrowse":
         {
             return Utils.GetEmbeddedImage("Workshare.SharedRibbon.Library.Resources.browse.png");
         }
         case "SaveToWorkshareButton":
         {
             return Utils.GetEmbeddedImage("Workshare.SharedRibbon.Library.Resources.save-icon.png");
         }
         case "ShareToWorkshareButton":
         {
             return Utils.GetEmbeddedImage("Workshare.SharedRibbon.Library.Resources.share-icon.png");
         }
         case "Bullet1":
         case "Bullet2":
         case "Bullet3":
         case "Bullet4":
         case "Bullet5":
         case "Bullet6":
         case "Bullet7":
         case "Bullet8":
         {
             return Utils.GetEmbeddedImage("Workshare.SharedRibbon.Library.Resources.bullet.png");
         }
             
         default:
         {
             return Image;
         }
     }
 }
        public void CreateModel(IRibbonControl control)
        {
            SelectTemplate t = new SelectTemplate();
            if (t.ShowDialog().Value)
            {
                //MessageDialog x = new MessageDialog("Creating Model...", Constants.AddInName);
                //x.DoAction(
                //    (dialog) =>
                //    {
                        Excel.Application app = ExcelUtil.Application;
                        Excel.Workbook wb = app.Workbooks.Open(t.SelectedTemplateFullPath);

                        Excel.Worksheet currentSheet = (Excel.Worksheet)wb.ActiveSheet;
                        Excel.Worksheet ws = (Excel.Worksheet)wb.Worksheets.Add();
                        ws.Name = "Config";
                        ws.Visible = Excel.Enums.XlSheetVisibility.xlSheetVeryHidden;
                        currentSheet.Activate();
                        ws.Range("A1").Value = t.SelectedTemplate;

                        //dialog.SetMessage("Done!");
                        //dialog.Resume();
                //    }
                //);
            }
        }
        public void HighlightWords(IRibbonControl control)
        {
            Window context = control.Context as Window;

            try
            {
                WordMatcher matcher = new WordMatcher(AppRegKey);
                matcher.LoadHightlightDefineFile(null);

                string pageId = OneNoteHelper.HierarchyHelper.GetActiveObjectID(context.Application, OneNoteHelper.HierarchyHelper._ObjectType.Page);
                HighlightPage(context.Application, pageId, matcher);
                //OneNoteHelper.HierarchyHelper.GoThoughHierarchy(context.Application, (application, pageId) => HighlightPage(application, pageId, matcher));
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.ToString(), "Error");
                EventLog.WriteEntry(EventLogSource, ex.ToString());
            }
            finally
            {
                context = null;
                GC.Collect();
                GC.WaitForPendingFinalizers();
                GC.Collect();
            }
        }
 public void CreateIssue(IRibbonControl ribbonControl)
 {
     //TODO create proper task window and show it here.. selectedMailItem will be populated properly
     new Window
         {
             Content = new TextBlock { Text = string.Format("Create issue here for {0}", selectedMailItem.Subject)}
         }.Show();
 }
        public void CreateIssue(IRibbonControl ribbonControl)
        {
            if (!CanCreateIssue) return;

            var issueViewModel = createIssuesViewModelFactory();
            issueViewModel.Initialise(selectedMailItem);
            contentHost.AddOrActivate(issueViewModel);
            CanCreateIssue = false;
        }
Exemple #8
0
        public object GetItemId(IRibbonControl control, int index)
        {
            var field = FindRibbonCmd(control.Id) as IDynamicItemsField;
            var list = field?.ItemId();
            if (list == null || list.Count <= index)
                return null;
            return list[index];

        }
 // RunTagMacro helper function
 public virtual void RunTagMacro(IRibbonControl control)
 {
     if (!string.IsNullOrEmpty(control.Tag))
     {
         // CONSIDER: Is this a danger for shutting down - surely not...?
         object app = ExcelDnaUtil.Application;
         app.GetType().InvokeMember("Run", BindingFlags.InvokeMethod, null, app, new object[] { control.Tag }, new CultureInfo(1033));
     }
 }
Exemple #10
0
        public void OnAction(IRibbonControl control)
        {
            var field = FindRibbonCmd(control.Id) as IActionField;
            if (field == null) { return; }

            if (field.OnActionField.CanExecute.Invoke())
            {
                field.OnActionField.Execute.Invoke();
            };
        }
Exemple #11
0
 private void adxRibbonButton1_OnClick(object sender, IRibbonControl control, bool pressed)
 {
   Excel.Range selectedRange = null;
   if (ExcelApp.Selection is Excel.Range)
   {
     selectedRange = ExcelApp.Selection as Excel.Range;
   }
   Form derpForm = new ParamMapForm(selectedRange);
   derpForm.ShowDialog();
 }
 public void OnMainButtonClick(IRibbonControl control)
 {
     HTMLGenerator.IsResizeFont = IsSizeChange;
     var l = cli.GetCurrentId();
     var px = cli.GetPageContent(l);
     var xe = HTMLGenerator.CreateFromXml(px);
     var id = HTMLGenerator.PageId;
     id = id.Remove(id.LastIndexOf('}')).Remove(0, id.LastIndexOf('{') + 1);
     var xmlPath = System.IO.Path.Combine(pathdict, id + ".html");
     HTMLGenerator.WriteXml(xmlPath, xe);
 }
        public void RegisterRibbonExtension(IRibbonControl ribbonControl, string location)
        {
            ribbon.RegisterDataExtension(ribbonControl.GetXmlDefinition(), location);

            // Select all command to register
            if (ribbonControl.Command != null)
            {
                ribbonCommands.Add(ribbonControl.Command);
            }

            isRegistedRibbons = true;
        }
        public IPictureDisp GetImage(IRibbonControl control)
        {
            switch (control.Id)
            {
                case "createTask":
                    {
                        return base.GetPicture(Properties.Resources.gtfo32x32);
                    }
            }

            return null;
        }
        public void Invoke(IRibbonControl control, Expression<Action> caller, params object[] parameters)
        {
            try
            {
                CallbackTarget callbackTarget =
                    vstoContribContext.TagToCallbackTargetLookup[control.Tag + caller.GetMethodName()];

                IRibbonViewModel viewModelInstance = ribbonViewModelResolver.ResolveInstanceFor(control.Context);

                Type type = viewModelInstance.GetType();
                PropertyInfo property = type.GetProperty(callbackTarget.Method);

                if (property != null)
                {
                    type.InvokeMember(callbackTarget.Method,
                        BindingFlags.SetProperty,
                        null,
                        viewModelInstance,
                        new[]
                        {
                            parameters.Single()
                        });
                }
                else
                {
                    type.InvokeMember(callbackTarget.Method,
                        BindingFlags.InvokeMethod,
                        null,
                        viewModelInstance,
                        new[]
                        {
                            control
                        }
                            .Concat(parameters)
                            .ToArray());
                }
            }
            catch (TargetInvocationException e)
            {
                var innerEx = e.InnerException;
                PreserveStackTrace(innerEx);
                if (vstoContribContext.ErrorHandlers.Count == 0)
                {
                    Trace.TraceError(innerEx.ToString());
                }

                var handled = vstoContribContext.ErrorHandlers.Any(errorHandler => errorHandler.Handle(innerEx));

                if (!handled)
                    throw innerEx;
            }
        }
Exemple #16
0
        public string GetLabel(IRibbonControl control)
        {
            if (!string.IsNullOrEmpty(control.Tag))
            {
                var index = Convert.ToInt32(control.Tag);
                if (index > _recentFolders.Count - 1)
                {
                    return string.Empty;
                }

                return MakePrettyBreadcrumb(_recentFolders[index]);
            }
            return string.Empty;
        }
        public string InvokeGetContent(IRibbonControl control, Expression<Action> caller, params object[] parameters)
        {
            // Remove any previous registered callbacks for this dynamic context
            vstoContribContext.RemoveCallbacksForDynamicContext(control.Tag);
            
            // Delegate to the view model to get the raw xml
            var xmlString = InvokeGet(control, caller, parameters);

            if (xmlString == null) return null;

            // Rewrite the XML with our callbacks, registering new callback targets
            var ribbonXmlRewriter = new RibbonXmlRewriter(vstoContribContext, ribbonViewModelResolver);
            var ribbonType = vstoContribContext.TagToCallbackTargetLookup[control.Tag + caller.GetMethodName()].RibbonType;
            return ribbonXmlRewriter.RewriteDynamicXml(ribbonType, control.Tag, xmlString.ToString());
        }
        public void CreateIssue(IRibbonControl control)
        {
            if (mailItem == null) return;

            if (tasks.User == null)
                tasks.Login();

            tasks.Title = mailItem.Subject;
            tasks.Sender = mailItem.Sender.Name;
            tasks.ReceivedDate = mailItem.ReceivedTime;
            tasks.Body = string.Format("Sender: {0} <{1}>\nReceived: {2}\n\n{3}",
                                        mailItem.Sender.Name,
                                        mailItem.Sender.Address,
                                        mailItem.ReceivedTime.ToString(CultureInfo.CurrentCulture),
                                        mailItem.Body);

            new GithubExplorerWindow(tasks).Show();
        }
Exemple #19
0
        // This will enable the form to be displayed when clicking the add in button
        public void ShowForm(IRibbonControl control)
        {
            Window context = control.Context as Window;
            if (context != null)
            {
                CWin32WindowWrapper owner = new CWin32WindowWrapper((IntPtr)context.WindowHandle);
                MainForm form = new MainForm(_applicationObject as Application);
                form.ShowDialog(owner);

                form.Dispose();
                form = null;
                context = null;
                owner = null;
            }
            GC.Collect();
            GC.WaitForPendingFinalizers();
            GC.Collect();
        }
        public object InvokeGet(IRibbonControl control, Expression<Action> caller, params object[] parameters)
        {
            var methodName = caller.GetMethodName();
            CallbackTarget callbackTarget = vstoContribContext.TagToCallbackTargetLookup[control.Tag + methodName];

            var view = (object)control.Context;
            IRibbonViewModel viewModelInstance = ribbonViewModelResolver.ResolveInstanceFor(view);
            VstoContribLog.Debug(l => l("Ribbon callback {0} being invoked on {1} (View: {2}, ViewModel: {3})",
                methodName, control.Id, view.ToLogFormat(), viewModelInstance.ToLogFormat()));

            Type type = viewModelInstance.GetType();
            PropertyInfo property = type.GetProperty(callbackTarget.Method);

            if (property != null)
            {
                return type.InvokeMember(callbackTarget.Method,
                                         BindingFlags.GetProperty,
                                         null,
                                         viewModelInstance,
                                         null);
            }

            try
            {
                return type.InvokeMember(callbackTarget.Method,
                                         BindingFlags.InvokeMethod,
                                         null,
                                         viewModelInstance,
                                         new[]
                                         {
                                             control
                                         }
                                             .Concat(parameters)
                                             .ToArray());
            }
            catch (MissingMethodException)
            {
                throw new InvalidOperationException(
                    string.Format("Expecting method with signature: {0}.{1}(IRibbonControl control)",
                                  type.Name,
                                  callbackTarget.Method));
            }
        }
        public void OpenMainForm_Click(IRibbonControl ribbon)
        {
            try
            {
                if (_mainForm == null)
                {
                    _mainForm = new Xero2ExcelWinForm(new ExcelApplicationWrapper(Application), ServiceLocator.Current);
                }

                if (!_mainForm.Visible)
                {
                    _mainForm.Show();
                }
            }
            catch (Exception ex)
            {
                ShowGeneralError(ex);
            }
        }
        public void KindleSync(IRibbonControl control)
        {
            // Extract information from the form.
            //
            AmazonRegistrationForm inputForm = new AmazonRegistrationForm();
            inputForm.ShowDialog();
            inputForm.Focus();

            if (inputForm.User == null)
            {
                return;
            }

            string username = inputForm.User.UserName;
            string password = inputForm.User.Password;

            string sectionId = onApp.Windows.CurrentWindow.CurrentSectionId;

            // Getting content from amazon site.
            //
            HighlightsExtractor extractor = new HighlightsExtractor();
            extractor.LogIn(username, password);

            foreach (BookWithHighlights bookWithHighlights in extractor.Crawl())
            {
                StringBuilder sb = new StringBuilder();
                foreach (string highlight in bookWithHighlights.Highlights)
                {
                    sb.AppendLine(highlight);
                    sb.AppendLine();
                }

                string newPageId;
                onApp.CreateNewPage(sectionId, out newPageId);

                string newPageContent;
                onApp.GetPageContent(newPageId, out newPageContent);
                var doc = XDocument.Parse(newPageContent);
                var ns = doc.Root.Name.Namespace;

                onApp.UpdatePageContent(GetXDocForNewPage(newPageId, ns, bookWithHighlights.BookName, sb.ToString()).ToString());
            }
        }
        public void CreateIssue(IRibbonControl ribbonControl)
        {
            //TODO create proper task window and show it here.. selectedMailItem will be populated properly

            if (selectedMailItem == null) return;

            if(tasks.User == null)
                tasks.Login(settings.UserName, settings.Password);

            tasks.Title = selectedMailItem.Subject;
            tasks.Sender = selectedMailItem.Sender.Name;
            tasks.ReceivedDate = selectedMailItem.ReceivedTime;
            tasks.Body = string.Format("Sender: {0} <{1}>\nReceived: {2}\n\n{3}",
                                        selectedMailItem.Sender.Name,
                                        selectedMailItem.Sender.Address,
                                        selectedMailItem.ReceivedTime.ToString(CultureInfo.CurrentCulture),
                                        selectedMailItem.Body);

            new GithubExplorerWindow(tasks).Show();
        }
        public void CreateIssue(IRibbonControl ribbonControl)
        {
            if (selectedMailItem == null) return;

            // If we are not authenticated, authenticate before allowing user to create issue
            if (string.IsNullOrEmpty(Properties.Settings.Default.AuthToken))
            {
                settingsViewModel.LoginCallback(() => CreateIssue(ribbonControl));
                settingsTaskPane.Visible = true;
                return;
            }

            if (settingsTaskPane.Visible)
                settingsTaskPane.Visible = false;

            createIssuesViewModel.CreateIssueFor(selectedMailItem);
            selectedMailItem = null;
            MailItemSelected = false;
            createIssueTaskPane.Visible = true;
        }
        /// <summary>
        /// 彈出 HighLightCode 的表單
        /// Show HighLightCode Form
        /// </summary>
        public void ShowCodeForm(IRibbonControl control)
        {
            string outFileName = Guid.NewGuid().ToString();

            try
            {
                ProcessHelper processHelper = new ProcessHelper("NoteHighLightForm.exe",new string[]{control.Tag, outFileName});
                processHelper.IsWaitForInputIdle = true;
                processHelper.ProcessStart();
            }
            catch (Exception ex)
            {
                MessageBox.Show("執行NoteHighLightForm.exe發生錯誤,錯誤訊息為:" + ex.Message);
                return;
            }

            string fileName = Path.Combine(Path.GetTempPath(), outFileName + ".html");

            if (File.Exists(fileName))
                InsertHighLightCodeToCurrentSide(fileName);
        }
		private RibbonItemListDisplay GetRibbonItemListDisplay(IRibbonControl item) {
			var rils = new RibbonItemListDisplay() {
				SourceControl = item,
				HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch,
				Header = (item.Header as string),
				ItemName = (item as FrameworkElement).Name
			};

			if (item.Icon != null) {
				if (item.Icon is String)
					rils.Icon = new BitmapImage(new Uri(@"/BetterExplorer;component/" + item.Icon.ToString(), UriKind.Relative));
				else
					rils.Icon = (item.Icon as Image).Source;
			}

			if (item is Fluent.DropDownButton || item is Fluent.SplitButton || item is Fluent.InRibbonGallery) {
				rils.ShowMenuArrow = true;
			}
			else if (item is Fluent.CheckBox) {
				rils.ShowCheck = true;
			}

			return rils;
		}
Exemple #27
0
        public void FunctionsClick(IRibbonControl control)
        {
            Excel.Application app = (Excel.Application)ExcelDna.Integration.ExcelDnaUtil.Application;
            Excel.Range activeCell = app.ActiveCell;
            string origFormula = app.ActiveCell.Formula;

            // Add formula to Excel
            if (origFormula == "")
            {
                // Add equals sign if formula is blank
                activeCell.Formula = "=" + control.Tag + "()";
            }
            else
            {
                // Add plus sign if no valid operator exists at end of formula
                switch (origFormula[origFormula.Length - 1])
                {
                case ',':
                case '+':
                case '-':
                case '*':
                case '/':
                    activeCell.Formula += control.Tag + "()";
                    break;
                default:
                    activeCell.Formula += "+" + control.Tag + "()";
                    break;
                }
            }

            // Replace original formula if user escapes function dialog wizard
            if (!app.Dialogs[Excel.XlBuiltInDialog.xlDialogFunctionWizard].Show())
            {
                activeCell.Formula = origFormula;
            }
        }
Exemple #28
0
        public bool btnPlacementSlip_GetEnabled(IRibbonControl control)
        {
            dynamic templateName = ((DocumentProperties)(Globals.ThisAddIn.Application.ActiveDocument.BuiltInDocumentProperties))[WordOM.WdBuiltInProperty.wdPropertyTitle].Value.ToString();

            return(String.Equals(templateName, Constants.TemplateNames.QuoteSlip));
        }
 private void adxRibbonTabQuandlFormulaToggleSplitDisable_OnClick(object sender, IRibbonControl control, bool pressed)
 {
     //btnDisableFormula_Click
     Quandl.Shared.QuandlConfig.PreventCurrentExecution = true;
     SetExecutionToggleIcon();
 }
Exemple #30
0
 public void btnSyncTable_Click(IRibbonControl control)
 {
     SyncTable();
 }
Exemple #31
0
 public void btnConvertPDF_Click(IRibbonControl control)
 {
     Process.Start(@"C:\Program Files\Free PDF Solutions\FreePDFSolutions_PDF2Word.exe");
 }
Exemple #32
0
 public void InsertCodeBlockCmd(IRibbonControl control)
 {
     factory.GetCommand <InsertCodeBlockCommand>().Execute();
 }
Exemple #33
0
 public void InsertGreenStatusCmd(IRibbonControl control)
 {
     factory.GetCommand <InsertStatusCommand>().Execute(StatusColor.Green);
 }
Exemple #34
0
 public void OnAboutButtonPressed(IRibbonControl control)
 {
     helperClass.log.Info("On About button is pressed");
     MessageBox.Show("The Trading Economics Application Programming Interface (API) provides direct access to 300.000 economic indicators, exchange rates, stock market indexes, government bond yields and commodity prices. Youre Trading Economics Excel Add In Version: 1.2.4", "About");
 }
 /// <summary>
 /// Adds a ribbon control to the internal map
 /// </summary>
 /// <param name="ribbonControl">ribbon control to add</param>
 internal void AddRibbonControl(IRibbonControl ribbonControl)
 {
     _mapRibbonControls.Add(ribbonControl.CommandID, ribbonControl);
 }
Exemple #36
0
 public Bitmap imageSuper_GetImage(IRibbonControl control)
 {
     return(Resources.spam);
 }
Exemple #37
0
 /// <summary>
 /// Gets a Boolean value indicating whether Word or PowerPoint is installed.
 /// </summary>
 /// <param name="control"></param>
 /// <returns></returns>
 public bool GetOfficeInstalled(IRibbonControl control)
 {
     return(Office.IsWordInstalled() || Office.IsPowerPointInstalled());
 }
 public void OnButtonPressed(IRibbonControl control)
 {
     MessageBox.Show("Hello from control " + control.Id);
     DataWriter.WriteData();
 }
 private void adxRibbonTabCheckUpdate_OnClick(object sender, IRibbonControl control, bool pressed)
 {
     //btnCheckUpdate_Click
     this.logic.TaskPaneUpdater.Show <UI.UpdateControlHost>(control.Context, a => a.UpdateContent());
 }
 /// <summary>
 /// GetHelperText callback
 /// </summary>
 /// <param name="control">The control</param>
 /// <returns></returns>
 public string GetHelperText(IRibbonControl control)
 {
     return (string)ribbonFactoryController.InvokeGet(control, () => GetHelperText(null));
 }
 private void adxRibbonTabQuandlStopAll_OnClick(object sender, IRibbonControl control, bool pressed)
 {
     //btnStopAll_Click
     Shared.QuandlConfig.StopCurrentExecution = true;
 }
Exemple #42
0
 public void CollapseCmd(IRibbonControl control)
 {
     factory.GetCommand <CollapseCommand>().Execute();
 }
 private void adxRibbonTabQuandlUdfBuilder_OnClick(object sender, IRibbonControl control, bool pressed)
 {
     //udfBuilder_Click
     this.logic.TaskPaneUpdater.Show <UI.WizardGuideControlHost>(control.Context, h => h.Reset());
 }
Exemple #44
0
 public bool getState(IRibbonControl control)
 {
     return((apiKeyFrm.validApiKey == true) ? true : false);
 }
Exemple #45
0
 public void InsertHorizontalLineCmd(IRibbonControl control)
 {
     factory.GetCommand <InsertLineCommand>().Execute('─');
 }
Exemple #46
0
 public void OnHelpButtonPressed(IRibbonControl control)
 {
     helperClass.log.Info("On Help button is pressed");
     System.Diagnostics.Process.Start("http://github.com/ieconomics/excel-addin/wiki");
 }
Exemple #47
0
 public void InsertExpandCmd(IRibbonControl control)
 {
     factory.GetCommand <InsertExpandCommand>().Execute();
 }
Exemple #48
0
 public void EditStylesCmd(IRibbonControl control)
 {
     factory.GetCommand <EditStylesCommand>().Execute();
     ribbon.Invalidate();             // TODO: only if changes?
 }
Exemple #49
0
 public void IncreaseFontSizeCmd(IRibbonControl control)
 {
     factory.GetCommand <AlterSizeCommand>().Execute(1);
 }
Exemple #50
0
 public void btnHelp_Click(IRibbonControl control)
 {
     ShowHelp();
 }
Exemple #51
0
 public void OnCallButtonPressed(IRibbonControl control)
 {
     helperClass.log.Info("On Call button is pressed");
     System.Diagnostics.Process.Start("http://tradingeconomics.com/contact.aspx?subject=excel");
 }
 private void adxRibbonTabQuandlOpenSettings_OnClick(object sender, IRibbonControl control, bool pressed)
 {
     this.logic.TaskPaneUpdater.Show <UI.SettingsControlHost>(control.Context, h => h.Reset());
 }
 private void adxRibbonTabQuandlAbout_OnClick(object sender, IRibbonControl control, bool pressed)
 {
     this.logic.TaskPaneUpdater.Show <UI.AboutControlHost>(control.Context);
 }
Exemple #54
0
        public void btnAbout_Click(IRibbonControl control)
        {
            var about = new About();

            about.ShowDialog();
        }
Exemple #55
0
 public void btnWizard_Click(IRibbonControl control)
 {
     Globals.ThisAddIn.Application.ActiveDocument.LoadWizard(Enums.FormLoadType.RibbonClick);
 }
Exemple #56
0
 public string getLabelApi(IRibbonControl control)
 {
     return((apiKeyFrm.validApiKey == true) ? "Logout" : "Login");
 }
 /// <summary>
 /// OnTextChanged callback
 /// </summary>
 /// <param name="control">The control.</param>
 /// <param name="text">The text.</param>
 public void OnTextChanged(IRibbonControl control, string text)
 {
     ribbonFactoryController.Invoke(control, () => OnTextChanged(null, null), text);
 }
Exemple #58
0
        public Bitmap GetImage(IRibbonControl control)
        {
            switch (control.Id)
            {
            case "btnHelp":
            {
                return(new Bitmap(Resources.Help));
            }

            case "btnOpenBICalculator":
            {
                return(new Bitmap(Resources.BICalculator));
            }

            case "btnToggleLock":
            {
                return(new Bitmap(Resources.Lock));
            }

            case "btnConvertToManual":
            {
                return(new Bitmap(Resources.InsuranceManual));
            }

            case "btnConvertToPlacementSlip":
            {
                return(new Bitmap(Resources.PlacementSlip));
            }

            case "btnConvertToPlacementSlipHome":
            {
                return(new Bitmap(Resources.PlacementSlip));
            }

            case "btnTogleLockUnlock":
            {
                string mode = Globals.ThisAddIn.Application.ActiveDocument.GetPropertyValue(Constants.WordDocumentProperties.ToggleLockMode);
                return(String.Equals(mode, Constants.WordDocumentPropertyValues.ToggleLockModeLocked, StringComparison.OrdinalIgnoreCase) ? new Bitmap(Resources.Unlock) : new Bitmap(Resources.Lock));
            }

            case "btnConvertToQuoteSlip":
            {
                return(new Bitmap(Resources.QuoteSlip1));
            }

            case "btnTogleUnlock":
            {
                return(new Bitmap(Resources.Unlock));
            }

            case "btnHelpHome":
            {
                return(new Bitmap(Resources.Help));
            }

            case "btnSyncField":
            {
                return(new Bitmap(Resources.SyncField));
            }

            case "btnSyncTableHome":
            {
                return(new Bitmap(Resources.SyncTableInfo));
            }


            case "btnSyncTable":
            {
                return(new Bitmap(Resources.SyncTableInfo));
            }

            case "btnWizard":
            {
                return(new Bitmap(Resources.Wizard));
            }

            case "btnWizardHome":
            {
                return(new Bitmap(Resources.Wizard));
            }

            case "btnConvertPDF":
            {
                return(new Bitmap(Resources.pdf));
            }

            case "btnConvertPDFHome":
            {
                return(new Bitmap(Resources.pdf));
            }

            case "btnUpdateFields":
            {
                return(new Bitmap(Resources.calculator));
            }

            case "btnUpdateFieldsHome":
            {
                return(new Bitmap(Resources.calculator));
            }

            case "btnAbout":
            {
                return(new Bitmap(Resources.About));
            }

            case "btnAboutHome":
            {
                return(new Bitmap(Resources.About));
            }
            }
            return(null);
        }
 public static bool GetCheckBox_TweetingEnabled_InitialState(IRibbonControl control)
 {
     return ConfigManager.CurrentUserSpecific.IsEnabled;
 }
Exemple #60
0
        public bool btnFactFinderButton_GetEnabled(IRibbonControl control)
        {
            dynamic templateName = ((DocumentProperties)(Globals.ThisAddIn.Application.ActiveDocument.BuiltInDocumentProperties))[WordOM.WdBuiltInProperty.wdPropertyTitle].Value.ToString();

            return(String.Equals(templateName, Constants.TemplateNames.PreRenewalQuestionnaire));
        }