コード例 #1
0
ファイル: Menu.cs プロジェクト: laszlo-kiss/Dataphor
        protected override void InternalSetImage(System.Drawing.Image image)
        {
            IWindowsBarButton button = _menuItem as IWindowsBarButton;

            if (button != null)
            {
                button.Image = image;
            }
        }
コード例 #2
0
        // 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;
            }
        }
コード例 #3
0
 protected override void Deactivate()
 {
     try
     {
         base.Deactivate();
     }
     finally
     {
         try
         {
             DeallocateAccelerator();
         }
         finally
         {
             if (_control != null)
             {
                 _control.Dispose();
                 _control = null;
             }
         }
     }
 }