Пример #1
0
        public App()
        {
            InvkSMBCtrl.LibInitial();

            Current.Exit          += (sender, args) => SaveConfiguration();
            Current.SessionEnding += (sender, args) => SaveConfiguration();

            SystemEvents.PowerModeChanged += OnPowerModeChanged;
        }
Пример #2
0
        private Motherboard()
        {
            if (InvkSMBCtrl.LibInitial() != 0)
            {
                throw new DeviceInitializationException();
            }

            ledId    = InvkSMBCtrl.GetLEDId();
            identity = (MBIdentify)InvkSMBCtrl.GetMBId();
            ConnectMcu();
            LoadMemoryModules();
        }
Пример #3
0
        static void Main(string[] args)
        {
            try
            {
                var argsObj = ArgsParser.Parse(args);

                if (argsObj.ChangeAudioLed || argsObj.ChangeRgbLed)
                {
                    InvkSMBCtrl.LibInitial();

                    if (argsObj.ChangeAudioLed && argsObj.Mode.HasValue)
                    {
                        var audioled = AudioLedController.Create();
                        if (audioled != null)
                        {
                            audioled.SetMode(argsObj.Mode.Value);
                        }
                    }

                    if (argsObj.ChangeRgbLed)
                    {
                        var rgbled = RgbLedController.Create();
                        if (rgbled == null)
                        {
                            return;
                        }

                        if (argsObj.Mode.HasValue)
                        {
                            rgbled.SetMode(argsObj.Mode.Value);
                        }

                        if (argsObj.Color.HasValue)
                        {
                            if (argsObj.Mode == LedMode.Off || argsObj.Mode == LedMode.Unknown)
                            {
                                return;
                            }

                            rgbled.SetColor(argsObj.Color.Value);
                        }
                    }
                }
            }
            catch (OptionException e)
            {
                Console.WriteLine(e.Message);
                Console.WriteLine("Try `--help' for more information.");
            }
        }