Ejemplo n.º 1
0
        private void onRGBnFCButtonClick(object sender, EventArgs e)
        {
            var deviceList = HardwareManager.getInstance().getRGBnFCList();

            if (deviceList.Count == 1)
            {
                var form = new LightingForm(deviceList[0], 1);
                form.ShowDialog();
            }
            else
            {
                var menu = new ContextMenu();
                for (int i = 0; i < deviceList.Count; i++)
                {
                    int index = i;
                    var item  = new MenuItem(string.Format("{0}", i + 1), (sender2, e2) =>
                    {
                        var form = new LightingForm(deviceList[index], index + 1);
                        form.ShowDialog();
                    });
                    menu.MenuItems.Add(item);
                }

                var point = mRGBnFCButton.PointToClient(Control.MousePosition);
                menu.Show(mRGBnFCButton, point);
            }
        }
Ejemplo n.º 2
0
        private void onRGBnFCButtonClick(object sender, EventArgs e)
        {
            var form = new LightingForm(HardwareManager.getInstance().getRGBnFC());

            form.ShowDialog();
            form.Dispose();
        }