SetState() public static method

Sets the state of the progress bar.
public static SetState ( IntPtr windowHandle, TaskbarStates taskbarState ) : void
windowHandle IntPtr The handle of the window.
taskbarState TaskbarStates The state to set the progress bar to.
return void
Exemplo n.º 1
0
        void HideProgressScreen()
        {
            pnlProgress.Visible = false;
            menuStrip.Enabled
                          = lblGameDir.Enabled
                          = txtGameDir.Enabled
                          = btnSelectGameDir.Enabled
                          = splitContainer.Panel1.Enabled
                          = splitContainer.Panel2.Enabled
                          = true;
            treMerges.Select();

            TaskbarProgress.SetState(this.Handle, TaskbarProgress.TaskbarStates.NoProgress);
        }
Exemplo n.º 2
0
        DialogResult FoldersManagerFromThread(NesMenuCollection collection)
        {
            if (InvokeRequired)
            {
                return((DialogResult)Invoke(new Func <NesMenuCollection, DialogResult>(FoldersManagerFromThread), new object[] { collection }));
            }
            var constructor = new FoldersManagerForm(collection, MainForm);

            TaskbarProgress.SetState(this, TaskbarProgress.TaskbarStates.Paused);
            var result = constructor.ShowDialog();

            TaskbarProgress.SetState(this, TaskbarProgress.TaskbarStates.Normal);
            return(result);
        }
Exemplo n.º 3
0
        DialogResult SelectFileFromThread(string[] files)
        {
            if (InvokeRequired)
            {
                return((DialogResult)Invoke(new Func <string[], DialogResult>(SelectFileFromThread), new object[] { files }));
            }
            var form = new SelectFileForm(files);

            TaskbarProgress.SetState(this.Handle, TaskbarProgress.TaskbarStates.Paused);
            var result = form.ShowDialog();

            selectedFile = form.listBoxFiles.SelectedItem.ToString();
            TaskbarProgress.SetState(this.Handle, TaskbarProgress.TaskbarStates.Normal);
            return(result);
        }
Exemplo n.º 4
0
        public static void Main(string[] args)
        {
            // http://stackoverflow.com/questions/1295890/windows-7-progress-bar-in-taskbar-in-c

            //TaskbarProgress.SetState(Process.GetCurrentProcess().MainWindowHandle
            //    , TaskbarProgress.TaskbarStates.Indeterminate);

            //            or

            TaskbarProgress.SetValue(Process.GetCurrentProcess().MainWindowHandle, 50, 100);
            TaskbarProgress.SetState(Process.GetCurrentProcess().MainWindowHandle, TaskbarProgress.TaskbarStates.Paused);
            TaskbarProgress.SetState(Process.GetCurrentProcess().MainWindowHandle, TaskbarProgress.TaskbarStates.Error);

            RewriteToUltraApplication.AsProgram.Launch(typeof(Application));
        }
Exemplo n.º 5
0
 private void pDrop_DragDrop(object sender, DragEventArgs e)
 {
     string[] a = (string[])e.Data.GetData(DataFormats.FileDrop);
     if (a.Length == 1)
     {
         CreatePlayer(a[0]);
         Player.Play();
         TaskbarProgress.SetState(Handle, TaskbarStates.Normal);
     }
     else
     {
         lblInfo.Text      = "Drag a File to play over here";
         lblInfo.ForeColor = Color.Black;
     }
 }
Exemplo n.º 6
0
        public ITaskerView SetState(Tasker.State state)
        {
            if (state == taskState)
            {
                return(this);
            }
            try
            {
                if (Tasker.HostForm.InvokeRequired)
                {
                    return((ITaskerView)Tasker.HostForm.Invoke(new Func <Tasker.State, ITaskerView>(SetState), new object[] { state }));
                }
                switch (state)
                {
                case Tasker.State.Starting:
                case Tasker.State.Finishing:
                case Tasker.State.Waiting:
                    if (!(new Tasker.State[] { Tasker.State.Starting, Tasker.State.Finishing, Tasker.State.Waiting }).Contains(taskState))
                    {
                        TaskbarProgress.SetState(Tasker.HostForm, TaskbarProgress.TaskbarStates.NoProgress);
                        Thread.Sleep(20);     // workaround to make it work
                        TaskbarProgress.SetState(Tasker.HostForm, TaskbarProgress.TaskbarStates.Indeterminate);
                    }
                    break;

                case Tasker.State.Running:
                    TaskbarProgress.SetState(Tasker.HostForm, TaskbarProgress.TaskbarStates.Normal);
                    break;

                case Tasker.State.Undefined:
                case Tasker.State.Done:
                    TaskbarProgress.SetState(Tasker.HostForm, TaskbarProgress.TaskbarStates.NoProgress);
                    break;

                case Tasker.State.Paused:
                    TaskbarProgress.SetState(Tasker.HostForm, TaskbarProgress.TaskbarStates.Paused);
                    break;

                case Tasker.State.Error:
                    TaskbarProgress.SetState(Tasker.HostForm, TaskbarProgress.TaskbarStates.Error);
                    break;
                }
                taskState = state;
            }
            catch (InvalidOperationException) { }
            return(this);
        }
Exemplo n.º 7
0
        public static bool PromptDialog(string dialogText)
        {
            if (taskbarHandle != IntPtr.Zero)
            {
                TaskbarProgress.SetState(taskbarHandle, TaskbarProgress.TaskbarStates.Paused);
            }

            DialogResult result        = MessageDialog.ShowQuestion(dialogText, _("Question"), true);
            bool         isAffirmative = (result == DialogResult.Yes);

            if (taskbarHandle != IntPtr.Zero)
            {
                TaskbarProgress.SetState(taskbarHandle, TaskbarProgress.TaskbarStates.Normal);
            }

            return(isAffirmative);
        }
Exemplo n.º 8
0
        private void ChangeListItem(int ItemIndex, int SubIndex, string str)
        {
            int barMax = Program.totalCount;

            if (Program.scannedCount == barMax)
            {
                button1.Enabled = true;
                TaskbarProgress.SetState(this.Handle, TaskbarProgress.TaskbarStates.NoProgress);
                button2.Enabled = true;
                button3.Enabled = true;
            }
            else
            {
                TaskbarProgress.SetValue(this.Handle, Program.scannedCount, barMax);
            }
            progressBar1.Value = Program.scannedCount;
            listView1.Items[ItemIndex].SubItems[SubIndex].Text = str;
        }
Exemplo n.º 9
0
 private void WorkerForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     if ((thread != null) && (e.CloseReason == CloseReason.UserClosing))
     {
         if (MessageBox.Show(this, Resources.DoYouWantCancel, Resources.AreYouSure, MessageBoxButtons.YesNo, MessageBoxIcon.Warning)
             == System.Windows.Forms.DialogResult.No)
         {
             e.Cancel = true;
             return;
         }
         if (thread != null)
         {
             thread.Abort();
         }
         TaskbarProgress.SetState(this, TaskbarProgress.TaskbarStates.NoProgress);
         TaskbarProgress.SetValue(this, 0, 1);
     }
 }
Exemplo n.º 10
0
        private void Start()
        {
            if (ProcessCallback is null)
            {
                throw new InvalidOperationException("You can't load the form without a ProcessCallback");
            }

            if (AbortCallback is null)
            {
                Abort.Visible = false;
            }

            StartPosition = FormStartPosition.CenterParent;
            TaskbarProgress.SetState(TaskbarProgressBarState.Indeterminate);

            Reset();
            ProcessCallback(this);
        }
Exemplo n.º 11
0
        private void End()
        {
            Data.Session.Stage = 5;
            try { BackEndWorker.RefreshIcons(); }
            catch (Exception) { }
            Thread.Sleep(250);

            Invoke(new Action(() =>
            {
                PGB_ApplyChanges.Percentage = 100;
                if (Data.Session.Errors == 0)
                {
                    L_ApplyChanges_Info.Text = "Done";
                }
                else
                {
                    L_ApplyChanges_Info.Text = $"Done, {Data.Session.Errors}{(Data.Session.Errors == Data.Session.StageErrors[4] ? "" : " total")} errors occurred.";
                }
                if (Data.Session.Errors > 0)
                {
                    L_ApplyChanges_Info.ForeColor = FormDesign.Design.RedColor;
                }
                B_Abort.HueShade = null;
                B_Abort.Text     = "Done";
                B_Abort.Image    = Properties.Resources.Icon_Checkmark;
                PB_Final.Hide();
                TaskbarProgress.SetState(Handle, TaskbarProgress.TaskbarStates.NoProgress);

                if (!FormIsActive)
                {
                    FlashWindow.Flash(this, 5);
                }
            }));

#if DEBUG
            try
            {
                File.WriteAllText(@"C:\Users\DotCa\Desktop\AIC_LastMatches.txt", Data.Session.Files.Where(x => x.Match != null).Convert(x => "{\r\n" + $"    {x.ToString()}\r\n    {(x.Match == null ? "NULL" : x.Match.ToString())}" + "\r\n}\r\n").ListStrings());
                File.WriteAllText(@"C:\Users\DotCa\Desktop\AIC_Errors.txt", Data.Session.Exceptions.Where(x => x != null).Convert(x => $"--------------------------------------\r\n{x.ToString()}\r\n--------------------------------------\r\n\r\n").ListStrings());
            }
            catch (Exception) { }
#endif
        }
Exemplo n.º 12
0
        public FormOperationDialog(string operationName, bool autoCloseWhenDone, bool noProgressBar, Action <IProgressReporter> operation)
        {
            _autoCloseWhenDone = autoCloseWhenDone;
            _operation         = operation;
            InitializeComponent();

            Text = operationName;
            lstLog.SelectionHangingIndent = 50;

            this.SetActualSize();

            panelProgressBar.Visible = !noProgressBar;
            if (!noProgressBar && Application.OpenForms.Count > 0)
            {
                TaskbarProgress.SetState(Application.OpenForms[0].Handle, TaskbarProgress.TaskbarStates.Normal);
            }

            lstLog.BackColor = lstLog.BackColor.Multiply(Colors.Brightness);
        }
Exemplo n.º 13
0
 void ShowMessage(string text, string title)
 {
     if (Disposing)
     {
         return;
     }
     try
     {
         if (InvokeRequired)
         {
             Invoke(new Action <string, string>(ShowMessage), new object[] { text, title });
             return;
         }
         TaskbarProgress.SetState(this, TaskbarProgress.TaskbarStates.Paused);
         MessageBox.Show(this, text, title, MessageBoxButtons.OK, MessageBoxIcon.Information);
         TaskbarProgress.SetState(this, TaskbarProgress.TaskbarStates.Normal);
     }
     catch { }
 }
Exemplo n.º 14
0
        DialogResult WaitForClovershellFromThread()
        {
            if (InvokeRequired)
            {
                return((DialogResult)Invoke(new Func <DialogResult>(WaitForClovershellFromThread)));
            }
            SetStatus(Resources.WaitingForDevice);
            TaskbarProgress.SetState(this, TaskbarProgress.TaskbarStates.Paused);
            var result = WaitingClovershellForm.WaitForDevice(this);

            TaskbarProgress.SetState(this, TaskbarProgress.TaskbarStates.Normal);
            if (result)
            {
                return(DialogResult.OK);
            }
            else
            {
                return(DialogResult.Abort);
            }
        }
Exemplo n.º 15
0
        private void AddListItem(ListViewItem str)
        {
            this.listView1.Items.Add(str);
            ip ipEnum = new ip();
            //int barMax = Math.Abs(ipEnum.IPToNumber(textBox2.Text) - ipEnum.IPToNumber(textBox1.Text));
            int barMax = Program.totalCount;

            if (Program.scannedCount == barMax)
            {
                button1.Enabled = true;
                TaskbarProgress.SetState(this.Handle, TaskbarProgress.TaskbarStates.NoProgress);
                button2.Enabled = true;
                button3.Enabled = true;
            }
            else
            {
                TaskbarProgress.SetValue(this.Handle, Program.scannedCount, barMax);
            }
            progressBar1.Value = Program.scannedCount;
        }
Exemplo n.º 16
0
 private void backgroundWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     if (e.Error != null)
     {
         TaskbarProgress.SetState(formPublisher.Handle, TaskbarProgress.TaskbarStates.Error);
         MessageBox.Show("An error occurred during copying:" + Environment.NewLine + e.Error.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         Cleanup();
     }
     else if (e.Cancelled)
     {
         TaskbarProgress.SetState(formPublisher.Handle, TaskbarProgress.TaskbarStates.Paused);
         MessageBox.Show("Copy operation aborted.", "Abort", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         Cleanup();
     }
     else
     {
         TaskbarProgress.SetState(formPublisher.Handle, TaskbarProgress.TaskbarStates.Normal);
         MessageBox.Show("Copy operation completed successfully!", "Operation success", MessageBoxButtons.OK, MessageBoxIcon.Information);
         Cleanup();
     }
 }
Exemplo n.º 17
0
        void ShowError(Exception ex, bool dontStop = false)
        {
            if (Disposing)
            {
                return;
            }
            try
            {
                if (InvokeRequired)
                {
                    Invoke(new Action <Exception, bool>(ShowError), new object[] { ex, dontStop });
                    return;
                }
                TaskbarProgress.SetState(this.Handle, TaskbarProgress.TaskbarStates.Error);
                var message = ex.Message;
#if DEBUG
                message += ex.StackTrace;
#endif
                Debug.WriteLine(ex.Message + ex.StackTrace);
                if (ex is GameGenieFormatException || ex is GameGenieNotFoundException)
                {
                    MessageBox.Show(this, message, Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else if (ex is MadWizard.WinUSBNet.USBException)
                {
                    MessageBox.Show(this, message + "\r\n" + Resources.PleaseTryAgainUSB, Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    MessageBox.Show(this, message, Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                TaskbarProgress.SetState(this.Handle, TaskbarProgress.TaskbarStates.Normal);
                if (!dontStop)
                {
                    thread = null;
                    Close();
                }
            }
            catch { }
        }
Exemplo n.º 18
0
        DialogResult MessageBoxFromThread(IWin32Window owner, string text, string caption, MessageBoxButtons buttons,
                                          MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, bool tweak)
        {
            if (InvokeRequired)
            {
                return((DialogResult)Invoke(new MessageBoxFromThreadDelegate(MessageBoxFromThread),
                                            new object[] { owner, text, caption, buttons, icon, defaultButton, tweak }));
            }
            TaskbarProgress.SetState(this, TaskbarProgress.TaskbarStates.Paused);
            if (tweak)
            {
                MessageBoxManager.Register();        // Tweak button names
            }
            var result = MessageBox.Show(owner, text, caption, buttons, icon, defaultButton);

            if (tweak)
            {
                MessageBoxManager.Unregister();
            }
            TaskbarProgress.SetState(this, TaskbarProgress.TaskbarStates.Normal);
            return(result);
        }
Exemplo n.º 19
0
        void backgroundWorker_ProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            if (e.ProgressPercentage < 0)
            {
                toolStripProgressBar_Info.Style = ProgressBarStyle.Marquee;
                TaskbarProgress.SetState(this.Handle, TaskbarProgress.TaskbarStates.Indeterminate);
            }
            else
            {
                toolStripProgressBar_Info.Style = ProgressBarStyle.Blocks;
                toolStripProgressBar_Info.Value = e.ProgressPercentage;
                TaskbarProgress.SetValue(this.Handle, e.ProgressPercentage, 100);
            }

            OwnUserState userState = e.UserState as OwnUserState;

            labelInfo.Text = userState.Status;
            if (userState.UpdateNeeded == true)
            {
                dataGridView_Result.Refresh();
                userState.UpdateNeeded = false;
            }
        }
Exemplo n.º 20
0
 void backgroundWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     if (e.Error == null)
     {
         labelInfo.BackColor = System.Drawing.Color.Green;
         labelInfo.ForeColor = System.Drawing.Color.White;
         labelInfo.Text      = "Ready";
         TaskbarProgress.SetState(this.Handle, TaskbarProgress.TaskbarStates.NoProgress);
     }
     else
     {
         labelInfo.BackColor = System.Drawing.Color.Red;
         labelInfo.ForeColor = System.Drawing.Color.White;
         labelInfo.Text     += string.Format(" Exception: {0}. Operation incomplete.", e.Error.Message);
         TaskbarProgress.SetState(this.Handle, TaskbarProgress.TaskbarStates.Error);
     }
     toolStripProgressBar_Info.Value = 0;
     button_Start.Text = "Start";
     dataGridView_Result.Refresh();
     m_NumberOfWorkdays               = 0;
     dateTimePicker_EndDate.Enabled   = true;
     dateTimePicker_StartDate.Enabled = true;
 }
Exemplo n.º 21
0
        // Update the progress bar
        void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            // The progress percentage is a property of e
            progressBar1.Value = e.ProgressPercentage;

#if WINDOWS_7_BUILD
            try {
                TaskbarProgress.SetValue(this.Handle, e.ProgressPercentage, 100);

                if (progressStalled == 1)
                {
                    TaskbarProgress.SetState(this.Handle, TaskbarProgress.TaskbarStates.Error);
                }
                else
                {
                    TaskbarProgress.SetState(this.Handle, TaskbarProgress.TaskbarStates.Normal);
                }
            }
            catch (ObjectDisposedException a) {
                Console.WriteLine("Caught: {0}", a.Message);
            }
#endif
        }
Exemplo n.º 22
0
 void SetProgress(int value, int max)
 {
     if (Disposing)
     {
         return;
     }
     try
     {
         if (InvokeRequired)
         {
             Invoke(new Action <int, int>(SetProgress), new object[] { value, max });
             return;
         }
         if (value > max)
         {
             value = max;
         }
         progressBar.Maximum = max;
         progressBar.Value   = value;
         TaskbarProgress.SetState(this.Handle, TaskbarProgress.TaskbarStates.Normal);
         TaskbarProgress.SetValue(this.Handle, value, max);
     }
     catch { }
 }
Exemplo n.º 23
0
        DialogResult WaitForFelFromThread()
        {
            if (InvokeRequired)
            {
                return((DialogResult)Invoke(new Func <DialogResult>(WaitForFelFromThread)));
            }
            SetStatus(Resources.WaitingForDevice);
            if (fel != null)
            {
                fel.Close();
            }
            TaskbarProgress.SetState(this, TaskbarProgress.TaskbarStates.Paused);
            var result = WaitingFelForm.WaitForDevice(vid, pid, this);

            if (result)
            {
                fel = new Fel();
                if (!File.Exists(fes1Path))
                {
                    throw new FileNotFoundException(fes1Path + " not found");
                }
                if (!File.Exists(ubootPath))
                {
                    throw new FileNotFoundException(ubootPath + " not found");
                }
                fel.Fes1Bin  = File.ReadAllBytes(fes1Path);
                fel.UBootBin = File.ReadAllBytes(ubootPath);
                fel.Open(vid, pid);
                SetStatus(Resources.UploadingFes1);
                fel.InitDram(true);
                TaskbarProgress.SetState(this, TaskbarProgress.TaskbarStates.Normal);
                return(DialogResult.OK);
            }
            TaskbarProgress.SetState(this, TaskbarProgress.TaskbarStates.Normal);
            return(DialogResult.Abort);
        }
Exemplo n.º 24
0
 /// <summary>
 /// Marks the BackgroundWorker to be disposed and closes the progress bar form.
 /// </summary>
 static void Cleanup()
 {
     TaskbarProgress.SetState(formPublisher.Handle, TaskbarProgress.TaskbarStates.NoProgress);
     backgroundWorker.Dispose();
     formProgressBar.Close();
 }
Exemplo n.º 25
0
 private void btnCancel_Click(object sender, EventArgs e)
 {
     TaskbarProgress.SetState(formPublisher.Handle, TaskbarProgress.TaskbarStates.Paused);
     TaskbarProgress.SetValue(formPublisher.Handle, 0, pbMain.Maximum);
     backgroundWorker.CancelAsync();
 }
Exemplo n.º 26
0
 private void backgroundWorker_ProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     pbMain.Value = e.ProgressPercentage;
     TaskbarProgress.SetState(formPublisher.Handle, TaskbarProgress.TaskbarStates.Indeterminate);
     TaskbarProgress.SetValue(formPublisher.Handle, pbMain.Value, pbMain.Maximum);
 }
Exemplo n.º 27
0
        public static void EntryPoint(string[] args)
        {
            try
            {
                Console.InputEncoding  = Encoding.UTF8;
                Console.OutputEncoding = Encoding.UTF8;
                //string reallyLongDirectory = @"C:\Users\Daniel\Source\Repos\FolderRenameAssist\FolderRenameAssist\bin\Debug\New folder\[Ano Hi Mita Hana no Namae o Bokutachi wa Mada Shiranai][あの日見た花の名前を僕達はまだ知らない.][ANK-Raws] 劇場版 あの日見た花の名前を僕達はまだ知らない。 (BDrip x264 FLAC DTS TRUE-HD 5.1ch SUP Hi10P)\New Text Document.txt";
                //string reallyLongFile = @"D:\Downloaded\[Menelkir] THE iDOLM@STER Cinderella Girls (2012-2017) [MP3]\[2017-2017] CINDERELLA GIRLS THEATER\[2017-2017] CINDERELLA GIRLS THEATER 1st Season Theme\[2017.05.24] CINDERELLA GIRLS LITTLE STARS! エチュードは1曲だけ\08. lilac time (ピクニックライブ Acoustic Ver.) [bonus track].mp3";
                //Console.WriteLine($"Creating a directory that is {reallyLongDirectory.Length} characters long");
                //Directory.CreateDirectory(reallyLongDirectory);

                //Console.WriteLine(reallyLongFile);
                //Console.WriteLine(File.Exists(reallyLongFile));
                //Console.WriteLine(Processing.ComputeMD5(reallyLongFile));
                int StartingPoint = 0;
                Console.WriteLine("Version:" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString());
                Console.WriteLine("Proccessing Mode");
                Console.WriteLine("A. Verify Checksums");
                Console.WriteLine("\t(Initial index is 0, or you can input a different onem like {a,(ProcessingPower),50})");
                Console.WriteLine("\t(or input date format yyyy-MM-dd as Date filter, like {a," + DateTime.Today.AddHours(8).ToString("yyyy-MM-dd") + "} .)");
                Console.WriteLine("B. Verify File Existences and Path Length");
                Console.WriteLine("C. Combine All md5s into One");
                Console.WriteLine("D. Create Checksum for every folder.");
                Console.WriteLine("\t(Alternatively you can append input date format yyyy-MM-dd as Date filter, like {d,(ProcessingPower)," + DateTime.Today.ToString("yyyy-MM-dd") + "} .)");
                if (File.Exists(@"C:\ffmpeg\bin\ffmpeg.exe"))
                {
                    Console.WriteLine("E. Check all video files for corruption.");
                }
                Console.WriteLine("ProcessingPower : Single = 1, Half = 2, Full = 3");
                Console.WriteLine("Select Proccessing Mode : ");

                Input_ModeSection Input = Prepare.ParseModeSection(Console.ReadLine().ToLowerInvariant());

                switch (Input.Mode)
                {
                default:
                case Mode.Verify_Checksums:
                    if (!string.IsNullOrEmpty(Input.Optional_Parameter))
                    {
                        if (CheckParameter.IsDateParameter(Input.Optional_Parameter))
                        {
                            ReportFile = Prepare.ProduceReportName(WorkingDirectory, Input.Mode, ArgumentType.Date, Input.Optional_Parameter);
                            Processing.Verify(WorkingDirectory, ReportFile, Mode.Verify_Checksums, StartingPoint, Convert.ToDateTime(Input.Optional_Parameter).Date, true);
                            break;
                        }
                        else if (CheckParameter.IsIndexParameter(Input.Optional_Parameter))
                        {
                            StartingPoint = Convert.ToInt32(Input.Optional_Parameter);
                            ReportFile    = Prepare.ProduceReportName(WorkingDirectory, Input.Mode, ArgumentType.Index, Input.Optional_Parameter);
                            Processing.Verify(WorkingDirectory, ReportFile, Mode.Verify_Checksums, StartingPoint);
                            break;
                        }
                    }
                    ReportFile = Prepare.ProduceReportName(WorkingDirectory, Input.Mode);
                    Processing.Verify(WorkingDirectory, ReportFile, Mode.Verify_Checksums);
                    break;

                case Mode.Verify_Path_Length_and_Existences:
                    ReportFile = Prepare.ProduceReportName(WorkingDirectory, Input.Mode);
                    Processing.Verify(WorkingDirectory, ReportFile, Mode.Verify_Path_Length_and_Existences);
                    break;

                case Mode.Combine_All_MD5:
                    ReportFile = Prepare.ProduceReportName(WorkingDirectory, Input.Mode);
                    Processing.Verify(WorkingDirectory, ReportFile, Mode.Combine_All_MD5);
                    break;

                case Mode.Create_Checksum_for_Every_Folder:
                    if (CheckParameter.IsIndexParameter(Input.Optional_Parameter))
                    {
                        StartingPoint = Convert.ToInt32(Input.Optional_Parameter);
                    }
                    ReportFile = Prepare.ProduceReportName(WorkingDirectory, Input.Mode);
                    Processing.ParalleRefresh(WorkingDirectory, ReportFile, Mode.Create_Checksum_for_Every_Folder, Input.ProcessingPower, StartingPoint);
                    break;

                case Mode.Check_Video_Corruption:
                    if (!File.Exists(@"C:\ffmpeg\bin\ffmpeg.exe"))
                    {
                        throw new Exception(@"C:\ffmpeg\bin\ffmpeg.exe not found.");
                    }
                    ReportFile = Prepare.ProduceReportName(WorkingDirectory, Input.Mode);
                    Processing.VideoCheck(WorkingDirectory, ReportFile, Mode.Check_Video_Corruption);
                    break;
                }
                Console.WriteLine("Report generated @ " + ReportFile);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
                TaskbarProgress.SetState(Process.GetCurrentProcess().MainWindowHandle, TaskbarProgress.TaskbarStates.Error);
            }
            finally
            {
                ConsoleKeyInfo key = new ConsoleKeyInfo();
                while (key.Key != ConsoleKey.Enter)
                {
                    key = Console.ReadKey();
                }
            }
        }
Exemplo n.º 28
0
 public new void Close()
 {
     TaskbarProgress.SetState(Handle, TaskbarProgress.TaskbarStates.NoProgress);
     base.Close();
 }
Exemplo n.º 29
0
 public static double window_indeterminate(IntPtr Handle)
 {
     TaskbarProgress.SetState(Handle, TaskbarProgress.TaskbarStates.Indeterminate);
     return(1.0);
 }
Exemplo n.º 30
0
 public static double window_error(IntPtr Handle)
 {
     TaskbarProgress.SetState(Handle, TaskbarProgress.TaskbarStates.Error);
     return(1.0);
 }