コード例 #1
0
ファイル: TransferWindow.xaml.cs プロジェクト: huucp/tuneRobo
        public TransferWindow(DownloadMotionStoreRequest request, string motionTitle)
        {
            InitializeComponent();

            StoreRequest = request;
            StoreRequest.ProcessError += Request_ProcessError;
            StoreRequest.ProcessSuccessfully += StoreRequest_ProcessSuccessfully;
            StoreRequest.ProgressReport += Request_ProgressReport;
            StoreRequest.ProcessCancel += StoreRequest_ProcessCancel;

            ProgressBar.Maximum = 100;

            var viewModel = new TransferWindowViewModel();
            DataContext = viewModel;
            ViewModel = (TransferWindowViewModel)DataContext;
            ViewModel.Title = motionTitle;
            ViewModel.TransferText = (string)TryFindResource("DownloadingText");
        }
コード例 #2
0
ファイル: TransferWindow.xaml.cs プロジェクト: huucp/tuneRobo
 private void Request_ProcessError(DownloadMotionStoreRequest.DownloadMotionErrorCode errorcode, string errorMessage)
 {
     Dispatcher.BeginInvoke((Action)delegate
     {
         DialogResult = false;
         DebugHelper.WriteLine(errorMessage);
         Close();
         var title = (string)TryFindResource("DownloadErrorText");
         WPFMessageBox.Show(StaticMainWindow.Window, "", title, MessageBoxButton.OK, MessageBoxImage.Information,
                            MessageBoxResult.OK);
     });
 }
コード例 #3
0
 private void DownloadButton_Click(object sender, RoutedEventArgs e)
 {
     if (!GlobalVariables.UserOnline)
     {
         var signinWindow = new LoginWindow();
         if (signinWindow.ShowDialog(StaticMainWindow.Window) == false) return;
     }
     StaticMainWindow.Window.UpdateLoginSuccessfully();
     var request = new DownloadMotionStoreRequest(MotionID);
     var transferWindow = new TransferWindow(request, Info.title);
     if (transferWindow.ShowDialog(StaticMainWindow.Window) == true)
     {
         ViewModel.DownloadButtonContent = "Installed";
         GlobalFunction.SaveIconImage(ViewModel.CoverImage, MotionID);
     }
 }