private void LANTalkIcon_MouseClick(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) { IconMenu.Show(); } if (e.Button == MouseButtons.Left) { switch (Mode) { case 0: this.Show(); this.Activate(); this.WindowState = FormWindowState.Normal; break; case 1: ServerForm.Show(); ServerForm.Activate(); ServerForm.WindowState = FormWindowState.Normal; break; case 2: ClientForm.Show(); ClientForm.Activate(); ClientForm.WindowState = FormWindowState.Normal; break; } } }
static void Main() { IconMenu menu = new IconMenu(); menu.Show(); Application.Run(); }
/// <summary> /// 右键菜单 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void notify_MouseClick(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) { IconMenu.Items[0].Text = Program.infoResource.GetLocalizedString(language.InfoId.APPExit); IconMenu.Show(); } }
public void ToggleCanvas(Toggle t) { if (current != null) { current.toggle.isOn = false; current.canvas.gameObject.SetActive(false); current.canvas.enabled = false; current = null; } foreach (IconMenu im in iconMenus) { if(im == null) continue; if(im.canvas == null) continue; if (im.toggle.isOn) { current = im; im.canvas.gameObject.SetActive(true); im.canvas.enabled = true; } } }
public AppBarManager SetEvent(IconMenu type, EventHandler handler) { IconMenuItems[type].Click += handler; return this; }
public bool IsEnabled(IconMenu type) { return EnabledIconItems.Contains(type); }
public AppBarManager Enable(IconMenu type) { if (!EnabledIconItems.Contains(type)) { EnabledIconItems.Add(type); } return this; }
public AppBarManager Disable(IconMenu type) { if (EnabledIconItems.Contains(type)) { EnabledIconItems.Remove(type); } return this; }