예제 #1
0
        private async void StartProcessing()
        {
            try
            {
                SetUICrap_StartProcessing();

                foreach (ListViewItem item in listViewMain.Items)
                {
                    CurrentViewItem = item;

                    // yuk! quick 'n dirty feedback for UI
                    textBoxMain.Text += "\r\n\r\nProcessing: " + ProcessingModel.File.FullName;
                    textBoxMain.Text += "\r\nOutput: " + ProcessorUtil.GetOutputTmFullPath(ProcessingModel.File);


                    await Run(ProcessingModel.File.FullName, ProcessorUtil.GetOutputTmFullPath(ProcessingModel.File));


                    StatusBarProgressBar.Value++;
                    StatusBarPercentage.Text =
                        ProcessorUtil.GetPercentage(StatusBarProgressBar.Maximum, StatusBarProgressBar.Value) + "%";
                }
            }
            finally
            {
                SetUICrap_EndProcessing();
            }
        }
예제 #2
0
        private void AddTmFileToGrid(FileInfo tmFileInfo)
        {
            if (IsInGrid(tmFileInfo))
            {
                return;
            }

            var item = listViewMain.Items.Add(tmFileInfo.FullName);

            item.SubItems.Add(ProcessorUtil.GetOutputTmFullPath(tmFileInfo));
            item.SubItems.Add("0%");
            item.SubItems.Add("Waiting...");
            item.Tag = new ProcessingModel
            {
                File = tmFileInfo
            };
        }
예제 #3
0
        private void SetUICrap_StartProcessing()
        {
            // yuk! quick 'n dirty feedback for UI

            textBoxMain.Text  = string.Empty;
            textBoxMain.Text += "Start Processing\r\n";
            textBoxMain.Text += DateTime.Now + "\r\n";


            listViewMain.Enabled           = false;
            toolStripMain.Enabled          = false;
            aboutToolStripMenuItem.Enabled = false;

            StatusBarStatusLabel.Text    = "Processing...";
            StatusBarProgressBar.Value   = 0;
            StatusBarProgressBar.Maximum = listViewMain.Items.Count;
            StatusBarPercentage.Text     =
                ProcessorUtil.GetPercentage(StatusBarProgressBar.Maximum, StatusBarProgressBar.Value) + "%";
        }
예제 #4
0
        private void UpdateListViewItems(ProgressEventArgs e)
        {
            // yuk!!!  should really look at a binding approach

            if (listViewMain.InvokeRequired)
            {
                listViewMain.Invoke(new MethodInvoker(delegate
                {
                    listViewMain.Items[CurrentViewItem.Index].SubItems[2].Text =
                        ProcessorUtil.GetPercentage(e.TotalUnits, e.CurrentProgress) + "%";
                    listViewMain.Items[CurrentViewItem.Index].SubItems[3].Text = ProcessorUtil.GetProgressMessage(e);
                }));
            }
            else
            {
                CurrentViewItem.SubItems[2].Text = ProcessorUtil.GetPercentage(e.TotalUnits, e.CurrentProgress) + "%";
                CurrentViewItem.SubItems[3].Text = ProcessorUtil.GetProgressMessage(e);
            }
        }