예제 #1
0
        void btnPreviewFiles_Click(object sender, RoutedEventArgs e)
        {
            EnableDisableControls(false);
            //HideShowControls(System.Windows.Visibility.Hidden);
            WorkerRunning    = true;
            WorkerNotRunning = false;
            stopWorker       = false;

            WorkerJob job = new WorkerJob();

            job.RenameScript = txtRenameScript.Text;
            job.FileResults  = FileResults;

            previewWorker.RunWorkerAsync(job);
        }
예제 #2
0
        void previewWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            WorkerJob        job    = e.Argument as WorkerJob;
            BackgroundWorker worker = sender as BackgroundWorker;

            foreach (VideoLocalRenamedVM ren in job.FileResults)
            {
                if (stopWorker)
                {
                    return;
                }
                ren.NewFileName = "";
            }

            int curFile = 0;
            int delay   = 0;

            foreach (VideoLocalRenamedVM ren in job.FileResults)
            {
                if (stopWorker)
                {
                    return;
                }

                curFile++;
                delay++;

                JMMServerBinary.Contract_VideoLocalRenamed raw = JMMServerVM.Instance.clientBinaryHTTP.RenameFilePreview(
                    ren.VideoLocalID, job.RenameScript);

                ren.NewFileName = raw.NewFileName;
                ren.Success     = raw.Success;

                // do this so we don't lock the UI
                if (delay == 20)
                {
                    previewWorker.ReportProgress(0, new WorkerStatusContainer(job.FileResults.Count, curFile));
                    delay = 0;
                }
            }
        }
예제 #3
0
        void btnRenameFiles_Click(object sender, RoutedEventArgs e)
        {
            string           msg = string.Format(JMMClient.Properties.Resources.Rename_Confirm);
            MessageBoxResult res = MessageBox.Show(msg, JMMClient.Properties.Resources.Confirm, MessageBoxButton.YesNo, MessageBoxImage.Warning);

            if (res != MessageBoxResult.Yes)
            {
                return;
            }

            EnableDisableControls(false);

            WorkerRunning    = true;
            WorkerNotRunning = false;
            stopWorker       = false;

            WorkerJob job = new WorkerJob();

            job.RenameScript = txtRenameScript.Text;
            job.FileResults  = FileResults;

            renameWorker.RunWorkerAsync(job);
        }
예제 #4
0
        void btnRenameFiles_Click(object sender, RoutedEventArgs e)
        {
            string           msg = string.Format("Are you sure you want to rename the files below?");
            MessageBoxResult res = MessageBox.Show(msg, "Confirm", MessageBoxButton.YesNo, MessageBoxImage.Warning);

            if (res != MessageBoxResult.Yes)
            {
                return;
            }

            EnableDisableControls(false);

            WorkerRunning    = true;
            WorkerNotRunning = false;
            stopWorker       = false;

            WorkerJob job = new WorkerJob();

            job.RenameScript = txtRenameScript.Text;
            job.FileResults  = FileResults;

            renameWorker.RunWorkerAsync(job);
        }
예제 #5
0
		void btnPreviewFiles_Click(object sender, RoutedEventArgs e)
		{
			EnableDisableControls(false);
			//HideShowControls(System.Windows.Visibility.Hidden);
			WorkerRunning = true;
			WorkerNotRunning = false;
			stopWorker = false;

			WorkerJob job = new WorkerJob();
			job.RenameScript = txtRenameScript.Text;
			job.FileResults = FileResults;

			previewWorker.RunWorkerAsync(job);
			
		}
예제 #6
0
		void btnRenameFiles_Click(object sender, RoutedEventArgs e)
		{
			string msg = string.Format("Are you sure you want to rename the files below?");
			MessageBoxResult res = MessageBox.Show(msg, "Confirm", MessageBoxButton.YesNo, MessageBoxImage.Warning);

			if (res != MessageBoxResult.Yes) return;

			EnableDisableControls(false);

			WorkerRunning = true;
			WorkerNotRunning = false;
			stopWorker = false;

			WorkerJob job = new WorkerJob();
			job.RenameScript = txtRenameScript.Text;
			job.FileResults = FileResults;

			renameWorker.RunWorkerAsync(job);
		}
        void btnRenameFiles_Click(object sender, RoutedEventArgs e)
        {
            string msg = string.Format(JMMClient.Properties.Resources.Rename_Confirm);
            MessageBoxResult res = MessageBox.Show(msg, JMMClient.Properties.Resources.Confirm, MessageBoxButton.YesNo, MessageBoxImage.Warning);

            if (res != MessageBoxResult.Yes) return;

            EnableDisableControls(false);

            WorkerRunning = true;
            WorkerNotRunning = false;
            stopWorker = false;

            WorkerJob job = new WorkerJob();
            job.RenameScript = txtRenameScript.Text;
            job.FileResults = FileResults;

            renameWorker.RunWorkerAsync(job);
        }