示例#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
 public static void UnhandledExceptonHandler(object sender, UnhandledExceptionEventArgs args)
 {
     if (true == YesNoPopupWindow.AskQuestion(MainWindow.Instance, Utilities.GetString("AskSendReport") as string))
     {
         Process.Start(AppDomain.CurrentDomain.BaseDirectory + @"\BaronReplays.exe", "-force");
     }
 }
        public static Nullable <Boolean> AskQuestion(Window owner, String question)
        {
            YesNoPopupWindow askWindow = new YesNoPopupWindow();

            askWindow.Question = question;
            askWindow.Owner    = owner;
            askWindow.ShowDialog();
            return(askWindow.Agreed);
        }
        private void DeleteButton_Click(object sender, EventArgs e)
        {
            Nullable <bool> sure = YesNoPopupWindow.AskQuestion(MainWindow.Instance, String.Format(Utilities.GetString("SureDelete") as string, (this.DataContext as SimpleLoLRecord).FileNameShort));

            if (sure == true)
            {
                (DataContext as SimpleLoLRecord).DeleteRecord();
            }
        }
示例#5
0
 private void OpenFolderPathButton_Click(object sender, RoutedEventArgs e)
 {
     if (Directory.Exists(ReplaySavePath))
     {
         Process.Start(ReplaySavePath);
     }
     else
     {
         if (true == YesNoPopupWindow.AskQuestion(MainWindow.Instance, Utilities.GetString("DirectoryNotExist") as string))
         {
             Directory.CreateDirectory(ReplaySavePath);
             Process.Start(ReplaySavePath);
         }
     }
 }
示例#6
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     if (FeatureGameClicked != null)
     {
         GameInfo           info   = new GameInfo(Utilities.LoLObserveServersIpMapping[gameManager.Platform], NowDisplay.PlatformId, NowDisplay.gameId, NowDisplay.observers["encryptionKey"].ToString());
         Nullable <Boolean> result = YesNoPopupWindow.AskQuestion(MainWindow.Instance, Utilities.GetString("WatchNow") as string);
         if (result == true)
         {
             FeatureGameClicked(info, NowDisplay, true);
         }
         else if (result == false)
         {
             FeatureGameClicked(info, NowDisplay, false);
         }
     }
 }
示例#7
0
        private int ShringToTaskbar()
        {
            if (Properties.Settings.Default.AlwaysTaskbar)
            {
                return(1);
            }
            Nullable <Boolean> result = YesNoPopupWindow.AskQuestion(this, Utilities.GetString("ShrinkToTaskBarQuestion"));

            if (result == true)
            {
                return(1);
            }
            else if (result == false)
            {
                return(2);
            }
            return(0);
        }
示例#8
0
 private void OnMoviePostProcessingDone(MoviePostProcessor processor, Boolean isSuccess)
 {
     LockMainView = false;
     if (isSuccess)
     {
         ShowNotifyUserMessage(Utilities.GetString("MovieRecordingSuccessed"));
         Nullable <Boolean> result = YesNoPopupWindow.AskQuestion(this, String.Format(Utilities.GetString("MovieRecordingPlayNow"), processor.FilePath));
         if (result == true)
         {
             Process.Start(videoRecordingController.OutputFilePath);
         }
     }
     else
     {
         ShowExportFailedMessage();
     }
     EndVideoRecordingMode();
 }
示例#9
0
 public void LoLLauncherDone(bool isSuccess, string reason)
 {
     if (!isSuccess)
     {
         if (reason.CompareTo("OldVersionReplay") == 0)
         {
             Nullable <Boolean> result = YesNoPopupWindow.AskQuestion(this, String.Format(Utilities.GetString("OldVersionReplay")));
             if (result == true)
             {
                 GoToOldVersionReplayGuide();
             }
         }
         else
         {
             PopupWindow.ShowMessage(this, Utilities.GetString(reason) as String);
         }
     }
     _launcher = null;
 }
示例#10
0
 public bool CheckRamainRecorder()
 {
     if (Recorders == null)
     {
         return(true);
     }
     if (Recorders.Count == 0)
     {
         return(true);
     }
     if (YesNoPopupWindow.AskQuestion(this, String.Format(Utilities.GetString("RemainGame") as string, Recorders.Count)) == true)
     {
         foreach (KeyValuePair <LoLRecorder, Thread> pair in Recorders)
         {
             pair.Value.Abort();
         }
         return(true);
     }
     else
     {
         return(false);
     }
 }
示例#11
0
        public void ExportRecord(SimpleLoLRecord slr)
        {
            if (!Dispatcher.CheckAccess())
            {
                RecordDelegate prd = new RecordDelegate(ExportRecord);
                Dispatcher.Invoke(prd, slr);
                return;
            }
            if (videoRecordingController != null)
            {
                if (videoRecordingController.LoLStarted)
                {
                    bool?answer = YesNoPopupWindow.AskQuestion(this, Utilities.GetString("VideoRecordingExitCheck"));
                    if (answer.HasValue)
                    {
                        if (answer.Value)
                        {
                            EndVideoRecordingMode();
                        }
                    }
                }
                else
                {
                    EndVideoRecordingMode();
                }
                return;
            }
            toExport = slr;
            MovieConfiguration configurater = new MovieConfiguration();

            if (toExport != null)
            {
                configurater.FileNameBox.Text = slr.FileNameShort.Remove(slr.FileNameShort.Length - 4);
            }
            configurater.Done += MovieConfigurationDone;
            SwitchMainContent(configurater);
        }