Beispiel #1
0
 private void BtnCnCNetLobby_LeftClick(object sender, EventArgs e)
 {
     LastSwitchType = SwitchType.SECONDARY;
     primarySwitches[primarySwitches.Count - 1].SwitchOff();
     cncnetLobbySwitch.SwitchOn();
     privateMessageSwitch.SwitchOff();
 }
        private void BtnCnCNetLobby_LeftClick(object sender, EventArgs e)
        {
            LastSwitchType = SwitchType.SECONDARY;
            primarySwitches[primarySwitches.Count - 1].SwitchOff();
            cncnetLobbySwitch.SwitchOn();
            privateMessageSwitch.SwitchOff();

            // HACK warning
            // TODO: add a way for DarkeningPanel to skip transitions
            ((DarkeningPanel)((XNAControl)cncnetLobbySwitch).Parent).Alpha = 1.0f;
        }
Beispiel #3
0
 private void BtnMainButton_LeftClick(object sender, EventArgs e)
 {
     LastSwitchType = SwitchType.PRIMARY;
     cncnetLobbySwitch.SwitchOff();
     privateMessageSwitch.SwitchOff();
     primarySwitches[primarySwitches.Count - 1].SwitchOn();
 }
        private void BtnMainButton_LeftClick(object sender, EventArgs e)
        {
            LastSwitchType = SwitchType.PRIMARY;
            cncnetLobbySwitch.SwitchOff();
            privateMessageSwitch.SwitchOff();
            primarySwitches[primarySwitches.Count - 1].SwitchOn();

            // HACK warning
            // TODO: add a way for DarkeningPanel to skip transitions
            if (((XNAControl)primarySwitches[primarySwitches.Count - 1]).Parent is DarkeningPanel darkeningPanel)
            {
                darkeningPanel.Alpha = 1.0f;
            }
        }
        public void SwitchByUserInput()
        {
            var input = Console.ReadKey().Key;

            state = !state;

            while (input != ConsoleKey.Escape)
            {
                if (state)
                {
                    _myDevice.SwitchOn();
                }
                else
                {
                    _myDevice.SwitchOff();
                }

                input = Console.ReadKey().Key;
                state = !state;
            }
        }