protected override void InternalSetImage(System.Drawing.Image image) { IWindowsBarButton button = _menuItem as IWindowsBarButton; if (button != null) { button.Image = image; } }
// Node protected override void Activate() { IWindowsExposedHost host = (IWindowsExposedHost)FindParent(typeof(IWindowsExposedHost)); if (host != null) { _control = host.ExposedContainer.CreateMenuItem(new EventHandler(ControlClicked)); host.ExposedContainer.AddBarItem(_control, null); } try { base.Activate(); } catch { _control.Dispose(); _control = null; throw; } }
protected override void Deactivate() { try { base.Deactivate(); } finally { try { DeallocateAccelerator(); } finally { if (_control != null) { _control.Dispose(); _control = null; } } } }