コード例 #1
0
        private string _lastPresence; // we resend this if the state changes

        internal MainController(bool isLeague)
        {
            _trayIcon = new NotifyIcon
            {
                Icon            = Resources.deceive,
                Visible         = true,
                BalloonTipTitle = StartupHandler.DeceiveTitle,
                BalloonTipText  = "Deceive is currently masking your status. Right-Click the tray icon for more options."
            };
            _trayIcon.ShowBalloonTip(5000);

            // Create overlay and start following the LCU with it.
            if (isLeague)
            {
                var process = Process.GetProcessesByName("LeagueClientUx").First();

                _overlay = new LCUOverlay();
                _overlay.Show();
                _follower = new WindowFollower(_overlay, process);
                _follower.StartFollowing();
            }

            LoadStatus();
            UpdateUI();
        }
コード例 #2
0
        private async void CreateOverlay()
        {
            while (true)
            {
                var process = Process.GetProcessesByName("LeagueClientUx").FirstOrDefault();
                if (process == null)
                {
                    await Task.Delay(5000);

                    continue;
                }

                _overlay = new LCUOverlay();
                _overlay.Show();
                _follower = new WindowFollower(_overlay, process);
                _follower.StartFollowing();
                return;
            }
        }