Esempio n. 1
0
        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;
                }
            }
        }
Esempio n. 2
0
        static void Main()
        {
            IconMenu menu = new IconMenu();

            menu.Show();

            Application.Run();
        }
Esempio n. 3
0
 /// <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;
            }
        }
    }
Esempio n. 5
0
 public AppBarManager SetEvent(IconMenu type, EventHandler handler)
 {
     IconMenuItems[type].Click += handler;
     return this;
 }
Esempio n. 6
0
 public bool IsEnabled(IconMenu type)
 {
     return EnabledIconItems.Contains(type);
 }
Esempio n. 7
0
 public AppBarManager Enable(IconMenu type)
 {
     if (!EnabledIconItems.Contains(type))
     {
         EnabledIconItems.Add(type);
     }
     return this;
 }
Esempio n. 8
0
 public AppBarManager Disable(IconMenu type)
 {
     if (EnabledIconItems.Contains(type))
     {
         EnabledIconItems.Remove(type);
     }
     return this;
 }