コード例 #1
0
        public MenuItemPresenter(VirtualServer vServer, VirtualServer.State vServerState)
        {
            VirtualServer = vServer;

              //Build the root and sub-menu items
              BuildMenuItemStructure();

              //Update menu items to the current state
              Update(vServerState);
        }
コード例 #2
0
 public void Update(VirtualServer vServer, VirtualServer.State state)
 {
     if (dispatcher.InvokeRequired)
       {
     dispatcher.Invoke(updateWithoutThreadChecksAction, new object[] { vServer, state });
       }
       else
       {
     UpdateWithoutThreadChecks(vServer, state);
       }
 }
コード例 #3
0
        private void AddVirtualServerContextMenuItems(VirtualServer vServer)
        {
            //Create a virtual server menu item
              MenuItemPresenter vServerMenuItem = new MenuItemPresenter(vServer);

              //Add to the context menu
              cmsVirtualServer.Items.Add(vServerMenuItem.RootMenuItem);

              //Register the menu item
              menuItemMapper.Register(vServerMenuItem);
        }
コード例 #4
0
 private void UpdateWithoutThreadChecks(VirtualServer vServer, VirtualServer.State state)
 {
     mapping[vServer].Update(state);
 }
コード例 #5
0
 public void Update(VirtualServer.State vServerState)
 {
     this.vServerState = vServerState;
       UpdateRootMenuImage();
       UpdateTsmiOnOffText();
 }
コード例 #6
0
 public MenuItemPresenter(VirtualServer vServer)
     : this(vServer, vServer.Status)
 {
 }
コード例 #7
0
 private void UpdateNotifyIconBalloon(VirtualServer server, VirtualServer.State state)
 {
     switch (state)
       {
     case VirtualServer.State.Unknown:
       balloonService.DisplayWarning(String.Format("{0} is in an uknown state", server.Name));
       break;
     case VirtualServer.State.Poweroff:
       balloonService.DisplayInfo(String.Format("{0} has been powered off", server.Name));
       break;
     case VirtualServer.State.Running:
       balloonService.DisplayInfo(String.Format("{0} is running", server.Name));
       break;
     default:
       break;
       }
 }