Пример #1
0
        public void TryToPlayCommand(String command)
        {
            if (!Dispatcher.CheckAccess())
            {
                TryToPlayCommandDelegate act = new TryToPlayCommandDelegate(TryToPlayCommand);
                Dispatcher.Invoke(act, command);
                return;
            }
            Logger.Instance.WriteLog(String.Format("Play command line: {0}", command));
            LoLCommandAnalyzer lca = new LoLCommandAnalyzer(command);

            if (lca.IsSuccess)
            {
                Nullable <Boolean> result = YesNoPopupWindow.AskQuestion(this, Utilities.GetString("WatchNow") as string);
                if (result == true)
                {
                    StartNewRecoding(lca.GetGameInfo(), true);
                }
                else if (result == false)
                {
                    StartNewRecoding(lca.GetGameInfo(), false);
                }
            }
            else
            {
                PopupWindow.ShowMessage(this, Utilities.GetString("UselessCommand") as string);
            }
        }
Пример #2
0
        private void UpdateLoL()
        {
            Process pastLol = lol;

            lol = Utilities.GetProcess(Constants.LoLExeName);
            if (pastLol == null && lol != null)
            {
                ExecutionData                = new LoLExeData();
                ExecutionData.Process        = lol;
                ExecutionData.ExecutablePath = LeagueOfLegendsAnalyzer.GetLoLExecutingPath();
                ExecutionData.LogFilePath    = GetLogFilePath(ExecutionData.ExecutablePath);
                ExecutionData.CommandLine    = Utilities.GetCommandLine(lol.Id);
                ExecutionData.LoLProcess     = lol;
                LoLCommandAnalyzer analyzer = new LoLCommandAnalyzer(ExecutionData.CommandLine);

                ExecutionData.MatchInfo = analyzer.GetGameInfo();
                if (LoLStartedEvent != null)
                {
                    LoLStarted dele = new LoLStarted(LoLStartedEvent);
                    Dispatcher.Invoke(dele, this, ExecutionData, analyzer.IsSuccess);
                }
            }
            else if (pastLol != null && lol == null)
            {
                ExecutionData = null;
                if (LoLFinishedEvent != null)
                {
                    LoLFinishedEvent();
                }
            }
        }