Esempio n. 1
0
        public RemoteControlForm(LgService lgService, List <LgPreset> buttons)
        {
            _lgService = lgService;
            _buttons   = buttons;

            InitializeComponent();

            pnlMouse.MouseWheel += new MouseEventHandler(pnlMouse_MouseWheel);
        }
Esempio n. 2
0
        public LgGameBar(LgService lgService)
        {
            _lgService = lgService;

            _lgDevice = _lgService.SelectedDevice;

            _lgDevice.PictureSettingsChangedEvent += LgDevice_PictureSettingsChangedEvent;

            InitializeComponent();

            _toolTip = new ToolTip();
        }
Esempio n. 3
0
        public static async Task <bool> ExecutePresetAsync(string presetName)
        {
            try
            {
                var lgService = new LgService(Program.DataDir, true);
                await lgService.RefreshDevices(afterStartUp : true);

                var result = await lgService.ApplyPreset(presetName);

                if (!result)
                {
                    Console.WriteLine("Preset not found or error while executing.");
                }

                return(result);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error executing preset: " + ex.ToLogString());
                return(false);
            }
        }
        public RemoteControlPanel(LgService lgService, List <LgPreset> buttons)
        {
            _lgService = lgService;
            _buttons   = buttons;

            InitializeComponent();

            _backupImage = new Bitmap(pbRemote.Image);

            var txtCoords = Utils.GetResourceFile("RC_coords.txt");

            foreach (var line in txtCoords.Split('\n'))
            {
                var columns = line.Split(';');

                var name   = columns[0];
                var preset = _buttons.FirstOrDefault(p => p.name.Equals(name));
                if (preset != null)
                {
                    preset.X = int.Parse(columns[1]);
                    preset.Y = int.Parse(columns[2]);
                }
            }
        }