Exemplo n.º 1
0
        private void Stopped()
        {
            try
            {
                if (Main != null)
                {
                    Main.StoppedEvent -= Stopped;
                }

                timerProgessUpdate.Enabled = false;

                UpdateList();

                UpdateDBScannerArticleCount();
                UpdateProgressBar();

                if (Main != null && Main.Message)
                {
                    TimeSpan endTime = new TimeSpan(DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute,
                                                    DateTime.Now.Second, DateTime.Now.Millisecond).Subtract(StartTime);
                    lblCount.Text += " in " + endTime.ToString().TrimEnd('0');

                    // advise user if stopped due to reaching article match limit
                    if (Matches >= Limit)
                    {
                        lblCount.Text += " limit of " + Limit + " reached";
                    }
                }

                Main = null;
            }
            catch (Exception ex)
            {
                ErrorHandler.HandleException(ex);
            }
            finally
            {
                UpdateControls(false);
            }
        }
Exemplo n.º 2
0
        private void Stopped()
        {
            try
            {
                if (Main != null)
                {
                    Main.StoppedEvent -= Stopped;
                }

                progressBar.Value          = 0;
                lblPercentageComplete.Text = "100%";

                timerProgessUpdate.Enabled = false;

                UpdateList();

                UpdateDBScannerArticleCount();

                TimeSpan endTime = new TimeSpan(DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute,
                                                DateTime.Now.Second, DateTime.Now.Millisecond);
                endTime = endTime.Subtract(StartTime);

                if (Main != null && Main.Message)
                {
                    MessageBox.Show(lbArticles.Items.Count + " matches in " + endTime.ToString().TrimEnd('0'));
                }

                Main = null;
            }
            catch (Exception ex)
            {
                ErrorHandler.Handle(ex);
            }
            finally
            {
                UpdateControls(false);
            }
        }
Exemplo n.º 3
0
 private void DatabaseScanner_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (MessageBox.Show("Are you sure you want to close the Database Scanner?", "Close Scanner?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
     {
         e.Cancel = true;
     }
     else if (Main != null)
     {
         Main.Message = false;
         Main.Stop();
         Main = null;
     }
 }
Exemplo n.º 4
0
 private void StopButton()
 {
     timerProgessUpdate.Enabled = false;
     if (Main != null)
     {
         Main.Stop();
         Main = null;
     }
     TimeSpan endTime = new TimeSpan(DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second, DateTime.Now.Millisecond);
     endTime = endTime.Subtract(StartTime);
     MessageBox.Show(lbArticles.Items.Count + " matches in " + endTime.ToString().TrimEnd('0'));
 }
Exemplo n.º 5
0
        private void Stopped()
        {
            try
            {
                if (Main != null)
                {
                    Main.StoppedEvent -= Stopped;
                }

                progressBar.Value = 0;
                lblPercentageComplete.Text = "100%";

                timerProgessUpdate.Enabled = false;

                UpdateList();

                UpdateDBScannerArticleCount();

                TimeSpan endTime = new TimeSpan(DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute,
                                                DateTime.Now.Second, DateTime.Now.Millisecond);
                endTime = endTime.Subtract(StartTime);

                if (Main != null && Main.Message)
                    MessageBox.Show(lbArticles.Items.Count + " matches in " + endTime.ToString().TrimEnd('0'));

                Main = null;
            }
            catch (Exception ex)
            {
                ErrorHandler.Handle(ex);
            }
            finally
            {
                UpdateControls(false);
            }
        }
Exemplo n.º 6
0
        private void Start()
        {
            MakePatterns();

            StartTime = new TimeSpan(DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second, DateTime.Now.Millisecond);
            intLimit = (int)nudLimitResults.Value;

            List<Scan> s = new List<Scan>();

            s.Add(new CheckNamespace(namespaces));

            if (chkIgnoreRedirects.Checked)
                s.Add(new IsNotRedirect());

            if (chkArticleDoesContain.Checked)
            {
                if (ArticleContains != null) // simple search
                    s.Add(new TextContains(MakeReplacementDictionary(ArticleContains, ArticleCaseSensitive)));
                else // regex
                    s.Add(new TextContainsRegex(ArticleDoesRegex));
            }

            if (chkArticleDoesNotContain.Checked)
            {
                if (ArticleDoesNotContain != null)
                    s.Add(new TextDoesNotContain(MakeReplacementDictionary(ArticleDoesNotContain, ArticleCaseSensitive)));
                else
                    s.Add(new TextDoesNotContainRegex(ArticleDoesNotRegex));
            }

            if (chkTitleContains.Checked)
                s.Add(new TitleContains(TitleDoesRegex));

            if (chkTitleDoesNotContain.Checked)
                s.Add(new TitleDoesNotContain(TitleDoesNotRegex));

            if (chkSearchDates.Checked)
                s.Add(new DateRange(dtpFrom.Value, dtpTo.Value));

            if (chkProtection.Checked)
                s.Add(new Restriction(MoveDelete.EditProtectionLevel, MoveDelete.MoveProtectionLevel));

            if (cmboLength.SelectedIndex == 1)
                s.Add(new CountCharacters(MoreLessThan.MoreThan, (int)nudLength.Value));
            else if (cmboLength.SelectedIndex == 2)
                s.Add(new CountCharacters(MoreLessThan.LessThan, (int)nudLength.Value));

            if (cmboLinks.SelectedIndex == 1)
                s.Add(new CountLinks(MoreLessThan.MoreThan, (int)nudLinks.Value));
            else if (cmboLinks.SelectedIndex == 2)
                s.Add(new CountLinks(MoreLessThan.LessThan, (int)nudLinks.Value));

            if (cmboWords.SelectedIndex == 1)
                s.Add(new CountWords(MoreLessThan.MoreThan, (int)nudWords.Value));
            else if (cmboWords.SelectedIndex == 2)
                s.Add(new CountWords(MoreLessThan.LessThan, (int)nudWords.Value));

            if (chkBadLinks.Checked)
                s.Add(new HasBadLinks());
            if (chkNoBold.Checked)
                s.Add(new HasNoBoldTitle());
            if (chkCiteTemplateDates.Checked)
                s.Add(new CiteTemplateDates());
            if (chkUnbalancedBrackets.Checked)
                s.Add(new UnbalancedBrackets());
            if (chkSimpleLinks.Checked)
                s.Add(new HasSimpleLinks());
            if (chkHasHTML.Checked)
                s.Add(new HasHTMLEntities());
            if (chkHeaderError.Checked)
                s.Add(new HasSectionError());
            if (chkUnbulletedLinks.Checked)
                s.Add(new HasUnbulletedLinks());
            if (chkTypo.Checked)
                s.Add(new Typo());
            if (chkDefaultSort.Checked)
                s.Add(new MissingDefaultsort());

            Main = new MainProcess(s, fileName, Priority, chkIgnoreComments.Checked, txtStartFrom.Text);
            progressBar.Value = 0;
            Main.StoppedEvent += Stopped;
            Main.OutputQueue = Queue;
            Main.Start();
        }
Exemplo n.º 7
0
        private void Start()
        {
            MakePatterns();

            StartTime = new TimeSpan(DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second,
                                     DateTime.Now.Millisecond);
            Limit = (int)nudLimitResults.Value;

            List<Scan> s = new List<Scan>();

            if (Namespaces.Count > 0)
                s.Add(new CheckNamespace(Namespaces));

            if (chkIgnoreRedirects.Checked)
                s.Add(new IsNotRedirect());

            if (chkArticleDoesContain.Checked)
                s.Add(new TextContainsRegex(ArticleDoesContain));

            if (chkArticleDoesNotContain.Checked)
                s.Add(new TextDoesNotContainRegex(ArticleDoesNotContain));

            if (chkTitleContains.Checked)
                s.Add(new TitleContains(TitleDoesRegex));

            if (chkTitleDoesNotContain.Checked)
                s.Add(new TitleDoesNotContain(TitleDoesNotRegex));

            if (chkSearchDates.Checked)
                s.Add(new DateRange(dtpFrom.Value, dtpTo.Value));

            if (chkProtection.Checked)
                s.Add(new Restriction(MoveDelete.EditProtectionLevel, MoveDelete.MoveProtectionLevel));

            switch (cmboLength.SelectedIndex)
            {
                case 1:
                    s.Add(new CountCharacters(MoreLessThan.MoreThan, (int)nudLength.Value));
                    break;
                case 2:
                    s.Add(new CountCharacters(MoreLessThan.LessThan, (int)nudLength.Value));
                    break;
            }

            switch (cmboLinks.SelectedIndex)
            {
                case 1:
                    s.Add(new CountLinks(MoreLessThan.MoreThan, (int)nudLinks.Value));
                    break;
                case 2:
                    s.Add(new CountLinks(MoreLessThan.LessThan, (int)nudLinks.Value));
                    break;
            }

            switch (cmboWords.SelectedIndex)
            {
                case 1:
                    s.Add(new CountWords(MoreLessThan.MoreThan, (int)nudWords.Value));
                    break;
                case 2:
                    s.Add(new CountWords(MoreLessThan.LessThan, (int)nudWords.Value));
                    break;
            }

            if (chkBadLinks.Checked)
                s.Add(new HasBadLinks());

            if (chkNoBold.Checked)
                s.Add(new HasNoBoldTitle());

            if (chkCiteTemplateDates.Checked)
                s.Add(new CiteTemplateDates());
            
            if(chkReorderReferences.Checked)
                s.Add(new ReorderReferences());

            if (chkPeopleCategories.Checked)
                s.Add(new PeopleCategories());

            if (chkUnbalancedBrackets.Checked)
                s.Add(new UnbalancedBrackets());

            if (chkSimpleLinks.Checked)
                s.Add(new HasSimpleLinks());

            if (chkHasHTML.Checked)
                s.Add(new HasHTMLEntities());

            if (chkHeaderError.Checked)
                s.Add(new HasSectionError());

            if (chkUnbulletedLinks.Checked)
                s.Add(new HasUnbulletedLinks());

            if (chkTypo.Checked)
                s.Add(new Typo());

            if (chkDefaultSort.Checked)
                s.Add(new MissingDefaultsort());

            Main = new MainProcess(s, FileName, Priority, chkIgnoreComments.Checked, txtStartFrom.Text)
                       {
                           OutputQueue = Queue
                       };

            progressBar.Value = 0;
            Main.StoppedEvent += Stopped;
            Main.Start();
        }
Exemplo n.º 8
0
        private void Start()
        {
            MakePatterns();

            StartTime = new TimeSpan(DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second,
                                     DateTime.Now.Millisecond);
            Limit = (int)nudLimitResults.Value;

            List <Scan> s = new List <Scan>();

            if (Namespaces.Count > 0)
            {
                s.Add(new CheckNamespace(Namespaces));
            }

            if (chkIgnoreRedirects.Checked)
            {
                s.Add(new IsNotRedirect());
            }

            if (chkArticleDoesContain.Checked)
            {
                s.Add(new TextContainsRegex(ArticleDoesContain));
            }

            if (chkArticleDoesNotContain.Checked)
            {
                s.Add(new TextDoesNotContainRegex(ArticleDoesNotContain));
            }

            if (chkTitleContains.Checked)
            {
                s.Add(new TitleContains(TitleDoesRegex));
            }

            if (chkTitleDoesNotContain.Checked)
            {
                s.Add(new TitleDoesNotContain(TitleDoesNotRegex));
            }

            if (chkSearchDates.Checked)
            {
                s.Add(new DateRange(dtpFrom.Value, dtpTo.Value));
            }

            if (chkProtection.Checked)
            {
                s.Add(new Restriction(MoveDelete.EditProtectionLevel, MoveDelete.MoveProtectionLevel));
            }

            switch (cmboLength.SelectedIndex)
            {
            case 1:
                s.Add(new CountCharacters(MoreLessThan.MoreThan, (int)nudLength.Value));
                break;

            case 2:
                s.Add(new CountCharacters(MoreLessThan.LessThan, (int)nudLength.Value));
                break;
            }

            switch (cmboLinks.SelectedIndex)
            {
            case 1:
                s.Add(new CountLinks(MoreLessThan.MoreThan, (int)nudLinks.Value));
                break;

            case 2:
                s.Add(new CountLinks(MoreLessThan.LessThan, (int)nudLinks.Value));
                break;
            }

            switch (cmboWords.SelectedIndex)
            {
            case 1:
                s.Add(new CountWords(MoreLessThan.MoreThan, (int)nudWords.Value));
                break;

            case 2:
                s.Add(new CountWords(MoreLessThan.LessThan, (int)nudWords.Value));
                break;
            }

            if (chkBadLinks.Checked)
            {
                s.Add(new HasBadLinks());
            }

            if (chkNoBold.Checked)
            {
                s.Add(new HasNoBoldTitle());
            }

            if (chkCiteTemplateDates.Checked)
            {
                s.Add(new CiteTemplateDates());
            }

            if (chkPeopleCategories.Checked)
            {
                s.Add(new PeopleCategories());
            }

            if (chkUnbalancedBrackets.Checked)
            {
                s.Add(new UnbalancedBrackets());
            }

            if (chkSimpleLinks.Checked)
            {
                s.Add(new HasSimpleLinks());
            }

            if (chkHasHTML.Checked)
            {
                s.Add(new HasHTMLEntities());
            }

            if (chkHeaderError.Checked)
            {
                s.Add(new HasSectionError());
            }

            if (chkUnbulletedLinks.Checked)
            {
                s.Add(new HasUnbulletedLinks());
            }

            if (chkTypo.Checked)
            {
                s.Add(new Typo());
            }

            if (chkDefaultSort.Checked)
            {
                s.Add(new MissingDefaultsort());
            }

            Main = new MainProcess(s, FileName, Priority, chkIgnoreComments.Checked, txtStartFrom.Text)
            {
                OutputQueue = Queue
            };

            progressBar.Value  = 0;
            Main.StoppedEvent += Stopped;
            Main.Start();
        }
Exemplo n.º 9
0
        private void Start()
        {
            MakePatterns();

            StartTime = new TimeSpan(DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second, DateTime.Now.Millisecond);
            intLimit  = (int)nudLimitResults.Value;

            List <Scan> s = new List <Scan>();

            s.Add(new CheckNamespace(namespaces));

            if (chkIgnoreRedirects.Checked)
            {
                s.Add(new IsNotRedirect());
            }

            if (chkArticleDoesContain.Checked)
            {
                if (ArticleContains != null) // simple search
                {
                    s.Add(new TextContains(MakeReplacementDictionary(ArticleContains, ArticleCaseSensitive)));
                }
                else // regex
                {
                    s.Add(new TextContainsRegex(ArticleDoesRegex));
                }
            }

            if (chkArticleDoesNotContain.Checked)
            {
                if (ArticleDoesNotContain != null)
                {
                    s.Add(new TextDoesNotContain(MakeReplacementDictionary(ArticleDoesNotContain, ArticleCaseSensitive)));
                }
                else
                {
                    s.Add(new TextDoesNotContainRegex(ArticleDoesNotRegex));
                }
            }

            if (chkTitleContains.Checked)
            {
                s.Add(new TitleContains(TitleDoesRegex));
            }

            if (chkTitleDoesNotContain.Checked)
            {
                s.Add(new TitleDoesNotContain(TitleDoesNotRegex));
            }

            if (chkSearchDates.Checked)
            {
                s.Add(new DateRange(dtpFrom.Value, dtpTo.Value));
            }

            if (chkProtection.Checked)
            {
                s.Add(new Restriction(MoveDelete.EditProtectionLevel, MoveDelete.MoveProtectionLevel));
            }

            if (cmboLength.SelectedIndex == 1)
            {
                s.Add(new CountCharacters(MoreLessThan.MoreThan, (int)nudLength.Value));
            }
            else if (cmboLength.SelectedIndex == 2)
            {
                s.Add(new CountCharacters(MoreLessThan.LessThan, (int)nudLength.Value));
            }

            if (cmboLinks.SelectedIndex == 1)
            {
                s.Add(new CountLinks(MoreLessThan.MoreThan, (int)nudLinks.Value));
            }
            else if (cmboLinks.SelectedIndex == 2)
            {
                s.Add(new CountLinks(MoreLessThan.LessThan, (int)nudLinks.Value));
            }

            if (cmboWords.SelectedIndex == 1)
            {
                s.Add(new CountWords(MoreLessThan.MoreThan, (int)nudWords.Value));
            }
            else if (cmboWords.SelectedIndex == 2)
            {
                s.Add(new CountWords(MoreLessThan.LessThan, (int)nudWords.Value));
            }

            Parsers parsers = new Parsers();

            if (chkBadLinks.Checked)
            {
                s.Add(new HasBadLinks());
            }
            if (chkNoBold.Checked)
            {
                s.Add(new HasNoBoldTitle(parsers));
            }
            if (chkSimpleLinks.Checked)
            {
                s.Add(new HasSimpleLinks());
            }
            if (chkHasHTML.Checked)
            {
                s.Add(new HasHTMLEntities(parsers));
            }
            if (chkHeaderError.Checked)
            {
                s.Add(new HasSectionError(parsers));
            }
            if (chkUnbulletedLinks.Checked)
            {
                s.Add(new HasUnbulletedLinks());
            }
            if (chkTypo.Checked)
            {
                s.Add(new Typo());
            }
            if (chkDefaultSort.Checked)
            {
                s.Add(new MissingDefaultsort(parsers));
            }

            Main = new MainProcess(s, fileName, Priority, chkIgnoreComments.Checked, txtStartFrom.Text);
            progressBar.Value  = 0;
            Main.StoppedEvent += Stopped;
            Main.OutputQueue   = Queue;
            Main.Start();
        }
Exemplo n.º 10
0
 private void Form1_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (Main != null)
     {
         Main.Message = false;
         Main.Stop();
         Main = null;
     }
 }
Exemplo n.º 11
0
        private void Stopped()
        {
            try
            {
                if (Main != null)
                {
                    Main.FoundArticle -= MessageReceived;
                    Main.StoppedEvent -= Stopped;
                }

                progressBar1.Value = 0;

                timerProgessUpdate.Enabled = false;

                lblCount.Text = lbArticles.Items.Count.ToString() + " results";

                TimeSpan endTime = new TimeSpan(DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second, DateTime.Now.Millisecond);
                endTime = endTime.Subtract(StartTime);

                if (Main != null && Main.Message)
                    MessageBox.Show(lbArticles.Items.Count.ToString() + " matches in " + endTime.ToString().TrimEnd('0'));

                Main = null;
            }
            catch (Exception ex)
            {
                ErrorHandler.Handle(ex);
            }
            finally
            {
                UpdateControls(false);
            }
        }
Exemplo n.º 12
0
        private void Start()
        {
            makePatterns();

            StartTime = new TimeSpan(DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second, DateTime.Now.Millisecond);
            intLimit = (int)nudLimitResults.Value;

            List<Scan> s = new List<Scan>();

            s.Add(new CheckNamespace(namespaces));

            if (ignoreRedirectsToolStripMenuItem1.Checked)
                s.Add(new IsNotRedirect());

            if (chkArticleDoesContain.Checked)
                s.Add(new TextDoesContain(ArticleDoesRegex));

            if (chkArticleDoesNotContain.Checked)
                s.Add(new TextDoesNotContain(ArticleDoesNotRegex));

            if (chkTitleContains.Checked)
                s.Add(new TitleDoesContain(TitleDoesRegex));

            if (chkTitleDoesNotContain.Checked)
                s.Add(new TitleDoesNotContain(TitleDoesNotRegex));

            if (cmboLength.SelectedIndex != 0)
            {
                if (cmboLength.SelectedIndex == 1)
                    s.Add(new CountCharacters(MoreLessThan.MoreThan, (int)nudLength.Value));
                else if (cmboLength.SelectedIndex == 2)
                    s.Add(new CountCharacters(MoreLessThan.LessThan, (int)nudLength.Value));
            }

            if (cmboLinks.SelectedIndex != 0)
            {
                if (cmboLinks.SelectedIndex == 1)
                    s.Add(new CountLinks(MoreLessThan.MoreThan, (int)nudLinks.Value));
                else if (cmboLinks.SelectedIndex == 2)
                    s.Add(new CountLinks(MoreLessThan.LessThan, (int)nudLinks.Value));
            }

            if (cmboWords.SelectedIndex != 0)
            {
                if (cmboWords.SelectedIndex == 1)
                    s.Add(new CountWords(MoreLessThan.MoreThan, (int)nudWords.Value));
                else if (cmboWords.SelectedIndex == 2)
                    s.Add(new CountWords(MoreLessThan.LessThan, (int)nudWords.Value));
            }

            Parsers parsers = new Parsers();

            if (rdoBadLinks.Checked)
                s.Add(new HasBadLinks());
            else if (rdoNoBold.Checked)
                s.Add(new HasNoBoldTitle(parsers));
            else if (rdoSimpleLinks.Checked)
                s.Add(new HasSimpleLinks());
            else if (rdoHasHTML.Checked)
                s.Add(new HasHTMLEntities(parsers));
            else if (rdoHeaderError.Checked)
                s.Add(new HasSectionError(parsers));
            else if (rdoUnbulletedLinks.Checked)
                s.Add(new HasUnbulletedLinks());
            else if (rdoTypo.Checked)
                s.Add(new Typo());

            Main = new MainProcess(s, fileName, Priority, ignoreCommentsToolStripMenuItem.Checked, txtStartFrom.Text);
            progressBar1.Maximum = (int)(Main.stream.Length / 1024);
            Main.FoundArticle += MessageReceived;
            Main.StoppedEvent += Stopped;
            Main.Start();
        }
Exemplo n.º 13
0
        private void Stopped()
        {
            try
            {
                if (Main != null)
                {
                    Main.StoppedEvent -= Stopped;
                }

                timerProgessUpdate.Enabled = false;

                UpdateList();

                UpdateDBScannerArticleCount();

                if (Main != null && Main.Message)
                {
                    TimeSpan endTime = new TimeSpan(DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute,
                                DateTime.Now.Second, DateTime.Now.Millisecond).Subtract(StartTime);
                    lblCount.Text += " in " + endTime.ToString().TrimEnd('0');
                }

                Main = null;
            }
            catch (Exception ex)
            {
                ErrorHandler.HandleException(ex);
            }
            finally
            {
                UpdateControls(false);
            }
        }
Exemplo n.º 14
0
        private void Start()
        {
            makePatterns();

            StartTime = new TimeSpan(DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second, DateTime.Now.Millisecond);
            intLimit = (int)nudLimitResults.Value;

            List<Scan> s = new List<Scan>();

            s.Add(new CheckNamespace(namespaces));

            if (chkIgnoreRedirects.Checked)
                s.Add(new IsNotRedirect());

            if (chkArticleDoesContain.Checked)
                s.Add(new TextDoesContain(ArticleDoesRegex));

            if (chkArticleDoesNotContain.Checked)
                s.Add(new TextDoesNotContain(ArticleDoesNotRegex));

            if (chkTitleContains.Checked)
                s.Add(new TitleDoesContain(TitleDoesRegex));

            if (chkTitleDoesNotContain.Checked)
                s.Add(new TitleDoesNotContain(TitleDoesNotRegex));

            if (chkSearchDates.Checked)
                s.Add(new DateRange(dtpFrom.Value, dtpTo.Value));

            //if (chkProtection.Checked)
            //    s.Add(new Restriction(MoveDelete.EditProtectionLevel, MoveDelete.MoveProtectionLevel));

            if (cmboLength.SelectedIndex == 1)
                s.Add(new CountCharacters(MoreLessThan.MoreThan, (int)nudLength.Value));
            else if (cmboLength.SelectedIndex == 2)
                s.Add(new CountCharacters(MoreLessThan.LessThan, (int)nudLength.Value));

            if (cmboLinks.SelectedIndex == 1)
                s.Add(new CountLinks(MoreLessThan.MoreThan, (int)nudLinks.Value));
            else if (cmboLinks.SelectedIndex == 2)
                s.Add(new CountLinks(MoreLessThan.LessThan, (int)nudLinks.Value));

            if (cmboWords.SelectedIndex == 1)
                s.Add(new CountWords(MoreLessThan.MoreThan, (int)nudWords.Value));
            else if (cmboWords.SelectedIndex == 2)
                s.Add(new CountWords(MoreLessThan.LessThan, (int)nudWords.Value));

            Parsers parsers = new Parsers();

            if (chkBadLinks.Checked)
                s.Add(new HasBadLinks());
            if (chkNoBold.Checked)
                s.Add(new HasNoBoldTitle(parsers));
            if (chkSimpleLinks.Checked)
                s.Add(new HasSimpleLinks());
            if (chkHasHTML.Checked)
                s.Add(new HasHTMLEntities(parsers));
            if (chkHeaderError.Checked)
                s.Add(new HasSectionError(parsers));
            if (chkUnbulletedLinks.Checked)
                s.Add(new HasUnbulletedLinks());
            if (chkTypo.Checked)
                s.Add(new Typo());
            if (chkDefaultSort.Checked)
                s.Add(new MissingDefaultsort(parsers));

            Main = new MainProcess(s, fileName, Priority, chkIgnoreComments.Checked, txtStartFrom.Text);
            progressBar.Maximum = (int)(Main.stream.Length / 1024);
            Main.FoundArticle += MessageReceived;
            Main.StoppedEvent += Stopped;
            Main.Start();
        }
Exemplo n.º 15
0
        private void Start()
        {
            makePatterns();

            StartTime = new TimeSpan(DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second, DateTime.Now.Millisecond);
            intLimit  = (int)nudLimitResults.Value;

            List <Scan> s = new List <Scan>();

            s.Add(new CheckNamespace(namespaces));

            if (ignoreRedirectsToolStripMenuItem1.Checked)
            {
                s.Add(new IsNotRedirect());
            }

            if (chkArticleDoesContain.Checked)
            {
                s.Add(new TextDoesContain(ArticleDoesRegex));
            }

            if (chkArticleDoesNotContain.Checked)
            {
                s.Add(new TextDoesNotContain(ArticleDoesNotRegex));
            }

            if (chkTitleContains.Checked)
            {
                s.Add(new TitleDoesContain(TitleDoesRegex));
            }

            if (chkTitleDoesNotContain.Checked)
            {
                s.Add(new TitleDoesNotContain(TitleDoesNotRegex));
            }

            if (cmboLength.SelectedIndex != 0)
            {
                if (cmboLength.SelectedIndex == 1)
                {
                    s.Add(new CountCharacters(MoreLessThan.MoreThan, (int)nudLength.Value));
                }
                else if (cmboLength.SelectedIndex == 2)
                {
                    s.Add(new CountCharacters(MoreLessThan.LessThan, (int)nudLength.Value));
                }
            }

            if (cmboLinks.SelectedIndex != 0)
            {
                if (cmboLinks.SelectedIndex == 1)
                {
                    s.Add(new CountLinks(MoreLessThan.MoreThan, (int)nudLinks.Value));
                }
                else if (cmboLinks.SelectedIndex == 2)
                {
                    s.Add(new CountLinks(MoreLessThan.LessThan, (int)nudLinks.Value));
                }
            }

            if (cmboWords.SelectedIndex != 0)
            {
                if (cmboWords.SelectedIndex == 1)
                {
                    s.Add(new CountWords(MoreLessThan.MoreThan, (int)nudWords.Value));
                }
                else if (cmboWords.SelectedIndex == 2)
                {
                    s.Add(new CountWords(MoreLessThan.LessThan, (int)nudWords.Value));
                }
            }

            Parsers parsers = new Parsers();

            if (rdoBadLinks.Checked)
            {
                s.Add(new HasBadLinks());
            }
            else if (rdoNoBold.Checked)
            {
                s.Add(new HasNoBoldTitle(parsers));
            }
            else if (rdoSimpleLinks.Checked)
            {
                s.Add(new HasSimpleLinks());
            }
            else if (rdoHasHTML.Checked)
            {
                s.Add(new HasHTMLEntities(parsers));
            }
            else if (rdoHeaderError.Checked)
            {
                s.Add(new HasSectionError(parsers));
            }
            else if (rdoUnbulletedLinks.Checked)
            {
                s.Add(new HasUnbulletedLinks());
            }
            else if (rdoTypo.Checked)
            {
                s.Add(new Typo());
            }

            Main = new MainProcess(s, fileName, Priority, ignoreCommentsToolStripMenuItem.Checked, txtStartFrom.Text);
            progressBar1.Maximum = (int)(Main.stream.Length / 1024);
            Main.FoundArticle   += MessageReceived;
            Main.StoppedEvent   += Stopped;
            Main.Start();
        }