public void OnLoad(IRibbonUI ribbon) { AppRibbon = ribbon; OnLoadEvent(new LoadEventArgs { Ribbon = AppRibbon }); }
public SettingsDialog(IRibbonUI ribbon) { InitializeComponent(); VerticalOffset = 4; if (NeedsLocalizing()) { Text = Resx.SettingsDialog_Text; Localize(new string[] { "okButton", "cancelButton" }); navTree.Nodes["contextNode"].Text = Resx.SettingsDialog_contextNode_Text; navTree.Nodes["favoritesNode"].Text = Resx.SettingsDialog_favoritesNode_Text; navTree.Nodes["highlightNode"].Text = Resx.SettingsDialog_highlightNode_Text; navTree.Nodes["pluginsNode"].Text = Resx.SettingsDialog_pluginsNode_Text; navTree.Nodes["ribbonNode"].Text = Resx.SettingsDialog_ribbonNode_Text; navTree.Nodes["searchNode"].Text = Resx.SettingsDialog_searchNode_Text; navTree.Nodes["snippetsNode"].Text = Resx.SettingsDialog_snippetshNode_Text; } this.ribbon = ribbon; provider = new SettingsProvider(); sheets = new Dictionary <int, SheetBase>(); navTree.SelectedNode = navTree.Nodes[0]; navTree.Focus(); }
public void RibbonLoaded(IRibbonUI ribbonUi) { ribbonUiLookup.Add(currentlyLoadingRibbon, ribbonUi); VstoContribLog.Debug(_ => _("ribbonTypeLookup.ContainsKey({0}) = {1}", currentlyLoadingRibbon, ribbonTypeLookup.ContainsKey(currentlyLoadingRibbon))); if (!ribbonTypeLookup.ContainsKey(currentlyLoadingRibbon)) { return; } var viewModelType = ribbonTypeLookup[currentlyLoadingRibbon]; foreach (var viewModelLookup in contextToViewModelLookup.Values .Where(viewModel => viewModel.GetType() == viewModelType && viewModel.RibbonUi == null)) { VstoContribLog.Debug(_ => _("Setting RibbonUi [{0}] for ViewModel", ribbonUi.ToLogFormat())); viewModelLookup.RibbonUi = ribbonUi; InvalidateRibbonForViewModel(viewModelLookup); } if (!ribbonUiLookup.ContainsKey(DefaultRibbon)) { ribbonUiLookup[DefaultRibbon] = ribbonUi; } }
// use async factory pattern to instantiate a new instance... public static async Task <PluginsSheet> Create(SettingsProvider provider, IRibbonUI ribbon) { var sheet = new PluginsSheet(provider, ribbon); await sheet.Initialize(); return(sheet); }
public KeyboardSheet(SettingsProvider provider, IRibbonUI ribbon) : base(provider) { InitializeComponent(); Name = "KeyboardSheet"; Title = Resx.KeyboardSheet_Text; if (NeedsLocalizing()) { Localize(new string[] { "introLabel", "clearButton", "resetButton", "resetAllButton" }); cmdColumn.HeaderText = Resx.word_Command; keyColumn.HeaderText = Resx.KeyboardSheet_keyColumn_HeaderText; } gridView.AutoGenerateColumns = false; gridView.Columns[0].DataPropertyName = "Description"; gridView.Columns[1].DataPropertyName = "Hotkey"; this.ribbon = ribbon; map = new BindingList <KeyMap>(LoadKeyboardMap().ToList()); gridView.DataSource = map; }
private PluginsSheet(SettingsProvider provider, IRibbonUI ribbon) : base(provider) { InitializeComponent(); Name = "PluginsSheet"; Title = Resx.PluginsSheet_Text; if (NeedsLocalizing()) { Localize(new string[] { "introLabel", "deleteLabel=word_Delete" }); nameColumn.HeaderText = Resx.word_Name; cmdColumn.HeaderText = Resx.word_Command; } toolStrip.Rescale(); gridView.AutoGenerateColumns = false; gridView.Columns[0].DataPropertyName = "Name"; this.ribbon = ribbon; pinProvider = new PluginsProvider(); }
public CommandFactory(ILogger logger, IRibbonUI ribbon, List <IDisposable> trash, IWin32Window owner) { this.logger = logger; this.ribbon = ribbon; this.owner = owner; this.trash = trash; }
/* * public override string GetCustomUI(string ribbonId) * { * _excel = new Application(null, ExcelDna.Integration.ExcelDnaUtil.Application); * string ribbonXml = GetCustomRibbonXML(); * return ribbonXml; * } * * private string GetCustomRibbonXML() * { * string ribbonXml; * var thisAssembly = typeof(CustomRibbon).Assembly; * var resourceName = typeof(CustomRibbon).Namespace + ".CustomRibbon.xml"; * * using (Stream stream = thisAssembly.GetManifestResourceStream(resourceName)) * using (StreamReader reader = new StreamReader(stream)) * { * ribbonXml = reader.ReadToEnd(); * } * * if (ribbonXml == null) * { * throw new MissingManifestResourceException(resourceName); * } * return ribbonXml; * } */ public void OnLoad(IRibbonUI ribbon) { if (ribbon == null) { throw new ArgumentNullException(nameof(ribbon)); } _thisRibbon = ribbon; _excel = new Application(null, ExcelDna.Integration.ExcelDnaUtil.Application); //added this //_excel.WorkbookActivateEvent += OnInvalidateRibbon; //_excel.WorkbookDeactivateEvent += OnInvalidateRibbon; //_excel.SheetActivateEvent += OnInvalidateRibbon; //_excel.SheetDeactivateEvent += OnInvalidateRibbon; _thisRibbon.Invalidate(); //if (_excel.ActiveWorkbook == null) //{ // _excel.Workbooks.Add(); //} //get apikey Utils.apiKey = System.Configuration.ConfigurationManager.AppSettings["apiKey"]; //get projects; _projects = Projects.GetProjects(Utils.apiKey); }
public void OnLoad(IRibbonUI ribbonUI) { this.ribbon = ribbonUI; Globals.ThisAddIn.Application.WindowSelectionChange += delegate { ribbon.Invalidate(); }; Globals.ThisAddIn.Application.WindowDeactivate += delegate { ribbon.Invalidate(); }; StatsManager.Changed += delegate { ribbonUI.Invalidate(); }; }
//Create callback methods here. For more information about adding callback methods, visit https://go.microsoft.com/fwlink/?LinkID=271226 public void Ribbon_Load(IRibbonUI ribbonUI) { _ribbon = ribbonUI; _buildGLStrategy = new BuildGLStrategy(); _priceImportStrategy = new PriceImportStrategy(); }
public SnippetsSheet(SettingsProvider provider, IRibbonUI ribbon) : base(provider) { InitializeComponent(); Name = "SnippetsSheet"; Title = Resx.SnippetsSheet_Text; if (NeedsLocalizing()) { Localize(new string[] { "introLabel", "deleteLabel", "deleteButton", "okButton", "cancelButton" }); nameColumn.HeaderText = Resx.SnippetsSheet_nameColumn_HeaderText; } toolStrip.Rescale(); gridView.AutoGenerateColumns = false; gridView.Columns[0].DataPropertyName = "Name"; this.ribbon = ribbon; snipsProvider = new SnippetsProvider(); snippets = new BindingList <Snippet>(LoadSnippets()); gridView.DataSource = snippets; }
public void OnLoad(IRibbonUI ribbonUi) { this._ribbonUi = ribbonUi; this._userManager = Container.Instance.Resolve <IUserManager>(); this._presentationService = Container.Instance.Resolve <IPresentationService>(); this._environmentManager = Container.Instance.Resolve <IEnvironmentManager>(); this._userManager.UserChanged += this.UserManager_UserChanged; this._environmentManager.EnvironmentChanged += this.EnvironmentManager_EnvironmentChanged; }
public void OnRibbonLoad(IRibbonUI ribbon) { if (ribbon == null) { throw new ArgumentNullException(nameof(ribbon)); } _thisRibbon = ribbon; }
public WordScenarios() { wordFacade = new Word2013Facade(); ribbonUI = new RibbonUITestDouble(); VstoContribLog.ToTrace(); VstoContribLog.SetLevel(VstoContribLogLevel.Debug); testAddInBase = new TestAddInBase(); sut = new WordRibbonFactory(testAddInBase); }
public ExcelController(Application excel, IRibbonUI modelingRibbon, string projectid, string viewid, string projectname, string viewname, List <string> properties = null) { _modelingRibbon = modelingRibbon; _excel = excel; _curproj = projectid; _curview = viewid; _curprojname = projectname; _curviewname = viewname; _properties = properties; }
public void OnLoad(IRibbonUI ribbonUi) { try { _log.Information("Loading Ribbon..."); _ribbonUi = ribbonUi; } catch (Exception ex) { ProcessUnhandledException(ex); } }
public async void OnLoad(IRibbonUI ribbon) { this.RibbonUI = ribbon; try { await this.Program.OnStart(this.AddIn); } catch (Exception e) { e.Handle(); } }
public void OnLoad(IRibbonUI ribbon) { try { this.ribbon = ribbon; myMainDict = new Dictionary <string, Dictionary <string, formulaColumns> >(); myFormulasDict = new Dictionary <string, formulaColumns>(); } catch (Exception ex) { helperClass.log.Error(ex); } }
public void PythonOnRibbonLoad(IRibbonUI ui) { Trace.TraceInformation("event OnRibbonLoad"); if (!created) { return; } try { context.ribbon = ui; python_delegate.on_ribbon_load(ui); } catch (Exception e) { Message(e.ToString()); } }
public async void OnLoad(IRibbonUI ribbon) { this.RibbonUI = ribbon; try { await this.Program.OnStart(this.AddIn); } catch (Exception e) { MessageBox.Show(e.ToString()); throw; } }
private void AddinModule_OnRibbonLoaded(object sender, IRibbonUI ribbon) { //var isActive = MSAA.IsReferencesTabActive(WordApp); var windowHandle = FindWindowByClass("OpusApp", IntPtr.Zero); me = GetAccessibleObjectFromHandle(windowHandle); this.ribbon = ribbon; var a = this.FindRibbonControl(""); var b = this.FindRibbonControl("Ribbon"); CalcActiveTab(); }
//======================================================================================== // Ribbon handlers //======================================================================================== #region Ribbon handlers /// <summary> /// Specified in Ribbon.xml, this method is called once the custom ribbon UI is loaded /// allowing us to store a reference to the ribbon control. /// </summary> /// <param name="ribbon"></param> public void RibbonLoaded(IRibbonUI ribbon) { logger.WriteLine("RibbonLoaded()"); this.ribbon = ribbon; using (var manager = new ApplicationManager()) { var locations = manager.GetLocations(); logger.WriteLine("OneNote backup folder:: " + locations.backupFolder); logger.WriteLine("OneNote default folder: " + locations.defaultFolder); logger.WriteLine("OneNote unfiled folder: " + locations.unfiledFolder); factory = new CommandFactory(logger, ribbon, trash, new Win32WindowHandle(new IntPtr((Int64)manager.Application.Windows.CurrentWindow.WindowHandle))); } }
public void RibbonLoaded(IRibbonUI ribbonUi) { ribbonUiLookup.Add(currentlyLoadingRibbon, ribbonUi); if (!ribbonTypeLookup.ContainsKey(currentlyLoadingRibbon)) { return; } var viewModelType = ribbonTypeLookup[currentlyLoadingRibbon]; foreach (var viewModelLookup in contextToViewModelLookup.Values .Where(viewModel => viewModel.GetType() == viewModelType && viewModel.RibbonUi == null)) { viewModelLookup.RibbonUi = ribbonUi; } }
public void onLoad(IRibbonUI ribbon) { try { logger.Info("onLoad: " + (ribbon != null).ToString()); ribbonUI = ribbon; if (ribbonUI != null) { ribbonUI.Invalidate(); } } catch (Exception ex) { logger.Error(ex); } }
/// <summary> /// リボンのロード処理 /// </summary> public void OnLoad(IRibbonUI ribbon) { XElement xml = XElement.Load(xmlPath); IEnumerable <XElement> infos = from item in xml.Elements("setting1") select item; foreach (XElement info in infos) { _orderPressed = info.Element(RibbonItem.発注制御ボタン).Value == "1" ? true : false; _updatePressed = info.Element(RibbonItem.更新制御ボタン).Value == "1" ? true : false; _port = info.Element(RibbonItem.ポート入力ボックス).Value; } _thisRibbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon)); settingUpdate("ApiToken", ""); }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // Ribbon handlers... /// <summary> /// Specified in Ribbon.xml, this method is called once the custom ribbon UI is loaded /// allowing us to store a reference to the ribbon control. /// </summary> /// <param name="ribbon"></param> public void RibbonLoaded(IRibbonUI ribbon) { //logger.WriteLine("RibbonLoaded()"); this.ribbon = ribbon; using (var manager = new ApplicationManager()) { var(backupFolder, defaultFolder, unfiledFolder) = manager.GetLocations(); logger.WriteLine("OneNote backup folder:: " + backupFolder); logger.WriteLine("OneNote default folder: " + defaultFolder); logger.WriteLine("OneNote unfiled folder: " + unfiledFolder); factory = new CommandFactory(logger, ribbon, trash, // looks complicated but necessary for this to work new Win32WindowHandle(new IntPtr((Int64)manager.WindowHandle))); } }
public void OnLoad(IRibbonUI ribbon) { _thisRibbon = ribbon ?? throw new ArgumentNullException(nameof(ribbon)); _excel.WorkbookActivateEvent += OnInvalidateRibbon; _excel.WorkbookDeactivateEvent += OnInvalidateRibbon; _excel.SheetActivateEvent += OnInvalidateRibbon; _excel.SheetDeactivateEvent += OnInvalidateRibbon; if (_excel.ActiveWorkbook == null) { _excel.Workbooks.Add(); } _excelController = ExcelController.Instance; _excelController.RibbonUI = ribbon; _excelController.ExcelApplication = _excel; }
public void OnLoad(IRibbonUI ribbon) { if (ribbon == null) { throw new ArgumentNullException(nameof(ribbon)); } _thisRibbon = ribbon; _excel.WorkbookActivateEvent += OnInvalidateRibbon; _excel.WorkbookDeactivateEvent += OnInvalidateRibbon; _excel.SheetActivateEvent += OnInvalidateRibbon; _excel.SheetDeactivateEvent += OnInvalidateRibbon; if (_excel.ActiveWorkbook == null) { _excel.Workbooks.Add(); } }
public FavoritesSheet(SettingsProvider provider, IRibbonUI ribbon) : base(provider) { InitializeComponent(); Name = "FavoritesSheet"; Title = Resx.FavoritesSheet_Text; if (NeedsLocalizing()) { Localize(new string[] { "introLabel", "optionsBox", "shortcutsBox", "sortButton", "upButton", "downButton", "deleteLabel", "deleteButton", "okButton", "cancelButton" }); nameColumn.HeaderText = Resx.FavoritesSheet_nameColumn_HeaderText; locationColumn.HeaderText = Resx.FavoritesSheet_locationColumn_HeaderText; } toolStrip.Rescale(); gridView.AutoGenerateColumns = false; gridView.Columns[0].DataPropertyName = "Name"; gridView.Columns[1].DataPropertyName = "Location"; this.ribbon = ribbon; shortcuts = provider.GetCollection(Name).Get <bool>("kbdshorts"); shortcutsBox.Checked = shortcuts; favorites = new BindingList <Favorite>(LoadFavorites()); gridView.DataSource = favorites; }
public void OnDisconnection(ext_DisconnectMode RemoveMode, ref Array custom) { int count = custom == null ? 0 : custom.Length; logger.WriteLine($"OnDisconnection(RemoveMode:{RemoveMode},{count})"); try { if (trash.Count > 0) { logger.WriteLine($"Disposing {trash.Count} streams"); foreach (var item in trash) { item?.Dispose(); } } } catch (Exception exc) { logger.WriteLine(exc); } logger.WriteLine("Closing log"); logger.Dispose(); logger = null; ribbon = null; trash = null; GC.Collect(); GC.WaitForPendingFinalizers(); var stopTimer = new Timer(); stopTimer.Elapsed += StopTimer_Elapsed; stopTimer.Interval = 2000; stopTimer.Start(); }
public void OnDisconnection(ext_DisconnectMode RemoveMode, ref Array custom) { int count = custom == null ? 0 : custom.Length; logger.WriteLine($"OnDisconnection(RemoveMode:{RemoveMode},{count})"); try { if (trash.Count > 0) { logger.WriteLine($"disposing {trash.Count} streams"); foreach (var item in trash) { item?.Dispose(); } } } catch (Exception exc) { logger.WriteLine("error disconnecting", exc); } logger.WriteLine("closing log"); logger.Dispose(); logger = null; ribbon = null; trash = null; GC.Collect(); GC.WaitForPendingFinalizers(); // this is a hack, modeless dialogs seem to keep OneNote open :-( Environment.Exit(0); }
public void OnLoadRibbonUI(IRibbonUI ribbonUI) { RibbonUI = ribbonUI; }
/// <summary> /// Ribbon_s the load. /// </summary> /// <param name="ribbonUi">The ribbon UI.</param> // ReSharper disable InconsistentNaming public virtual void Ribbon_Load(IRibbonUI ribbonUi) { VstoContribLog.Debug(_ => _("Ribbon_Load event raised: {0}", ribbonUi.ToLogFormat())); ribbonFactoryController.RibbonLoaded(ribbonUi); }
public void ribbonLoaded(IRibbonUI ribbon) { _TheRibbon = ribbon; }
//Create callback methods here. For more information about adding callback methods, visit http://go.microsoft.com/fwlink/?LinkID=271226 public void Ribbon_Load(IRibbonUI ribbonUi) { this._ribbon = ribbonUi; }
public void Ribbon_Load(IRibbonUI ribbonUI) { }
public void OnLoad(IRibbonUI ribbon) { this.ribbonPoly = ribbon; }
public void RibbonLoaded(IRibbonUI ribbonUi) { ribbonUiLookup.Add(currentlyLoadingRibbon, ribbonUi); if (!ribbonTypeLookup.ContainsKey(currentlyLoadingRibbon)) return; var viewModelType = ribbonTypeLookup[currentlyLoadingRibbon]; foreach (var viewModelLookup in contextToViewModelLookup.Values .Where(viewModel => viewModel.GetType() == viewModelType && viewModel.RibbonUi == null)) { VstoContribLog.Debug(_ => _("Setting RibbonUi [{0}] for ViewModel", ribbonUi.ToLogFormat())); viewModelLookup.RibbonUi = ribbonUi; InvalidateRibbonForViewModel(viewModelLookup); } if (!ribbonUiLookup.ContainsKey(DefaultRibbon)) { ribbonUiLookup[DefaultRibbon] = ribbonUi; } }
public void RibbonLoaded(IRibbonUI ribbonUi) { ribbonUiLookup.Add(currentlyLoadingRibbon, ribbonUi); if (!ribbonTypeLookup.ContainsKey(currentlyLoadingRibbon)) return; var viewModelType = ribbonTypeLookup[currentlyLoadingRibbon]; foreach (var viewModelLookup in contextToViewModelLookup.Values .Where(viewModel => viewModel.GetType() == viewModelType && viewModel.RibbonUi == null)) { viewModelLookup.RibbonUi = ribbonUi; } }
public void RibbonLoaded(IRibbonUI ribbonUi) { ribbonViewModelResolver.RibbonLoaded(ribbonUi); }
//private int currentPortfolioId = 0; //private bool developerGroupEnabled = false; public void OnLoad(IRibbonUI ribbon) { this.ribbon = ribbon; ribbonDispatcher = Dispatcher.CurrentDispatcher; Excel.Application app = ExcelUtil.Application; app.NewWorkbookEvent += NewWorkbookEventHandler; app.WorkbookActivateEvent += WorkbookActivateEventHandler; app.WorkbookDeactivateEvent += WorkbookDeactivateEventHandler; app.WorkbookOpenEvent += WorkbookOpenEventHandler; //RockportConsole.Out("Version: " + AutoUpdate.Version + " " + (AutoUpdate.IsExcel64Bit() ? "64-bit" : "32-bit")); }
public void OnLoad(IRibbonUI ribbon) { Ribbon = ribbon; }
/// <summary> /// Ribbon_s the load. /// </summary> /// <param name="ribbonUi">The ribbon UI.</param> // ReSharper disable InconsistentNaming public virtual void Ribbon_Load(IRibbonUI ribbonUi) { ribbonFactoryController.RibbonLoaded(ribbonUi); }
/// <summary> /// /// </summary> /// <param name="ribbonUI"></param> public void OnLoad(IRibbonUI ribbonUI) { }