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); }
public void Update(VirtualServer vServer, VirtualServer.State state) { if (dispatcher.InvokeRequired) { dispatcher.Invoke(updateWithoutThreadChecksAction, new object[] { vServer, state }); } else { UpdateWithoutThreadChecks(vServer, state); } }
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); }
private void UpdateWithoutThreadChecks(VirtualServer vServer, VirtualServer.State state) { mapping[vServer].Update(state); }
public void Update(VirtualServer.State vServerState) { this.vServerState = vServerState; UpdateRootMenuImage(); UpdateTsmiOnOffText(); }
public MenuItemPresenter(VirtualServer vServer) : this(vServer, vServer.Status) { }
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; } }