예제 #1
0
파일: frmMain.cs 프로젝트: mcskik/Utilities
        /// <summary>
        /// Update file progress indicator.
        /// </summary>
        void moSearch_EventUpdateProgress(object poSender, SearchEngine.EventParameters poEventArgs)
        {
            if (System.Windows.Forms.Cursor.Current != System.Windows.Forms.Cursors.WaitCursor)
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
            }
            int    nIncrement = poEventArgs.Number;
            string sMessage   = poEventArgs.Text;

            staStatusStrip.Text       = sMessage;
            toolStripStatusLabel.Text = sMessage;
            try
            {
                if (pbrPprogressBar.Value + nIncrement > pbrPprogressBar.Maximum)
                {
                    pbrPprogressBar.Maximum      += Math.Max(pbrPprogressBar.Maximum, nIncrement);
                    toolStripProgressBar.Maximum += Math.Max(toolStripProgressBar.Maximum, nIncrement);
                }
                pbrPprogressBar.Value      += nIncrement;
                toolStripProgressBar.Value += nIncrement;
            }
            catch
            {
            }
            finally
            {
                System.Windows.Forms.Application.DoEvents();
            }
        }
예제 #2
0
파일: frmMain.cs 프로젝트: mcskik/Utilities
        /// <summary>
        /// End file progress indicator.
        /// </summary>
        void moSearch_EventEndOfProgress(object poSender, SearchEngine.EventParameters poEventArgs)
        {
            pbrPprogressBar.Value = pbrPprogressBar.Maximum;
            string sMessage = poEventArgs.Text;

            staStatusStrip.Text                 = sMessage;
            toolStripStatusLabel.Text           = sMessage;
            toolStripProgressBar.Value          = toolStripProgressBar.Maximum;
            cmdSearch.Enabled                   = true;
            cmdCancel.Enabled                   = false;
            cmdClose.Enabled                    = true;
            System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
            System.Windows.Forms.Application.DoEvents();
        }
예제 #3
0
파일: frmMain.cs 프로젝트: mcskik/Utilities
        /// <summary>
        /// Start file progress indicator.
        /// </summary>
        void moSearch_EventBeginProgress(object poSender, SearchEngine.EventParameters poEventArgs)
        {
            System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
            cmdSearch.Enabled = false;
            cmdCancel.Enabled = true;
            cmdClose.Enabled  = false;
            int    nMaximum = poEventArgs.Number;
            string sMessage = poEventArgs.Text;

            staStatusStrip.Text          = sMessage;
            toolStripStatusLabel.Text    = sMessage;
            toolStripProgressBar.Minimum = 0;
            toolStripProgressBar.Maximum = nMaximum;
            toolStripProgressBar.Value   = 0;
            pbrPprogressBar.Minimum      = 0;
            pbrPprogressBar.Maximum      = nMaximum;
            pbrPprogressBar.Value        = 0;
            System.Windows.Forms.Application.DoEvents();
        }
예제 #4
0
파일: frmMain.cs 프로젝트: mcskik/Utilities
        /// <summary>
        /// Display found data in context.
        /// </summary>
        void moSearch_EventCriteriaPass(object poSender, SearchEngine.EventParameters poEventArgs)
        {
            string sData = poEventArgs.Text;

            if (txtResults.Text.Length <= 8192)
            {
                txtResults.Text += sData + Environment.NewLine;
            }
            else
            {
                if (!_resultsDisplayLimitReached)
                {
                    txtResults.Text            += "*************************" + Environment.NewLine;
                    txtResults.Text            += "* Display Limit Reached *" + Environment.NewLine;
                    txtResults.Text            += "*************************" + Environment.NewLine;
                    _resultsDisplayLimitReached = true;
                }
            }
            System.Windows.Forms.Application.DoEvents();
        }