private void InitializeButton( ) { // _logger.Info( "InitializeButton" ); if (_button != null) { Remove( ); } if (UseBlizzyIfPossible && BlizzysToolbarButton.IsAvailable) { _button = new BlizzysToolbarButton ( BlizzyNamespace, BlizzyButtonId, BlizzyToolTip, BlizzyText, BlizzyTexturePath, BlizzyVisibility ); } else { _button = new AppLauncherButton(LauncherTexture, LauncherVisibility); } _button.Open += OnButtonOn; _button.Close += OnButtonOff; _button.RightClick += OnRightClick; _button.Add( ); }
public void OnDestroy() { //Log.warn("Destroy called"); if (button != null) { button.Destroy(); button = null; } stopAutoHide(); }
/// <summary> /// Called by Unity when this instance is destroyed. /// </summary> public void OnDestroy() { if (_button != null) { _button.Remove(); _button.Open -= Button_Open; _button.Close -= Button_Close; _button = null; } }
public bool Equals(IToolbarButton other) { var item = other as iFactr.UI.ToolbarButton; if (item != null) { return(item.Equals(this)); } return(base.Equals(other)); }
private void RemoveToolbarButton(IToolbarButton buttonDescriptor) { var button = myToolbarButtons.SingleOrDefault(b => b.Caption == buttonDescriptor.Caption); if (button == null) { return; } button.Delete(false); }
public void Remove( ) { // _logger.Info( "Remove" ); if (_button != null) { _button.Open -= OnButtonOn; _button.Close -= OnButtonOff; _button.Remove( ); _button = null; } }
public bool Equals(IToolbarButton other) { var button = other as iFactr.UI.ToolbarButton; if (button != null) { return(button.Equals(this)); } return(base.Equals(other)); }
/// <summary> /// Determines whether the specified <see cref="iFactr.UI.IToolbarButton"/> is equal to this instance. /// </summary> /// <param name="other">The <see cref="iFactr.UI.IToolbarButton"/> to compare with this instance.</param> /// <returns><c>true</c> if the specified <see cref="iFactr.UI.IToolbarButton"/> is equal to this instance; /// otherwise, <c>false</c>.</returns> public bool Equals(IToolbarButton other) { ToolbarButton button = other as ToolbarButton; if (button != null) { return(Pair == button.Pair); } return(Pair == other); }
/// <summary> /// Called by Unity when the application is destroyed. /// </summary> public void OnApplicationQuit() { _logger.Trace("OnApplicationQuit"); if (_button != null) { _button.Remove(); _button.Open -= Button_Open; _button.Close -= Button_Close; _button = null; } }
private void AddToolbarButton( IToolbarButton buttonDescriptor ) { var button = (Office.CommandBarButton)myToolbar.Controls.Add( Office.MsoControlType.msoControlButton, missing, missing, missing, true ); button.Caption = buttonDescriptor.Caption; button.FaceId = buttonDescriptor.FaceId; button.Click += CreateHandler( buttonDescriptor.OnClickHandler ); myToolbarButtons.Add( button ); }
private void AddToolbarButton(IToolbarButton buttonDescriptor) { var button = (Office.CommandBarButton)myToolbar.Controls.Add( Office.MsoControlType.msoControlButton, missing, missing, missing, true); button.Caption = buttonDescriptor.Caption; button.FaceId = buttonDescriptor.FaceId; button.Click += CreateHandler(buttonDescriptor.OnClickHandler); myToolbarButtons.Add(button); }
public void Start() { if (button == null) { //Log.warn("Awake - button == null"); if (ToolbarManager.ToolbarAvailable) { button = setupBlizzyToolbarButton(); } else { button = setupStockToolbarButton(); } loadSettings(); } else { //Log.warn("Awake - button != null"); } }
/// <summary> /// Initializes the toolbar button. /// </summary> private void InitializeButton( ) { if (_button != null) { _button.Open -= Button_Open; _button.Close -= Button_Close; _button.Remove(); _button = null; } if (Config.UseBlizzysToolbar && BlizzysToolbarButton.IsAvailable) { _button = new BlizzysToolbarButton( ); } else { _button = new AppLauncherButton( ); } _button.Open += Button_Open; _button.Close += Button_Close; _button.Add( ); }
public bool Equals(IToolbarButton other) { var item = other as UI.ToolbarButton; return(item == null?ReferenceEquals(this, other) : item.Equals(this)); }
/// <summary> /// 添加按钮到工具栏方法 /// </summary> public void AddButton(IToolbarButton <TItem> button) => Buttons.Add(button);
private void RemoveToolbarButton( IToolbarButton buttonDescriptor ) { var button = myToolbarButtons.SingleOrDefault( b => b.Caption == buttonDescriptor.Caption ); if ( button == null ) { return; } button.Delete( false ); }
public void Configure(Action fn, AssetSrc assets, IToolbarButton btn) => Configure(fn, assets.sprites.Get(btn.GuiSprite()), btn.GuiText());
/// <summary> /// Initializes the toolbar button. /// </summary> private void InitializeButton() { if (_button != null) { _button.Open -= Button_Open; _button.Close -= Button_Close; _button.Remove(); _button = null; } if (Config.UseBlizzysToolbar && BlizzysToolbarButton.IsAvailable) { _button = new BlizzysToolbarButton(); } else { _button = new AppLauncherButton(); } _button.Open += Button_Open; _button.Close += Button_Close; _button.Add(); }