Beispiel #1
0
        private void bTryParse_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(tbName.Text) && String.IsNullOrEmpty(tbURL.Text) &&
                (String.IsNullOrEmpty(tbTag.Text) || String.IsNullOrEmpty(tbClass.Text)))
            {
                MessageBox.Show("Необходимо заполнить все обязательные поля!");
                return;
            }
            if (checkBox.Checked)
            {
                if (String.IsNullOrEmpty(tbPage.Text) || numStartPage.Value < 0 ||
                    numEndPage.Value < 0 || numStartPage.Value > numEndPage.Value)
                {
                    MessageBox.Show("Дополнительные настройки заполнены некорректно!");
                }
                else
                {
                    _settings = new WebSiteSettings(tbURL.Text, tbPage.Text, (int)numStartPage.Value, (int)numEndPage.Value);
                }
            }
            else
            {
                _settings = new WebSiteSettings(tbURL.Text);
            }

            string tagName = tbTag.Text, containerName = tbClass.Text;

            _parser = new WebSiteParser(tagName, containerName);

            _extractor = new ParseExtractor(_parser, _settings);
            _extractor.StartParsing();
            _extractor.NewData += OutputData;
        }
Beispiel #2
0
        protected void Application_Start()
        {
            var websiteSettings = new WebSiteSettings();

            DependencyManager.BootstrapForSystem("Web Site", websiteSettings, websiteSettings, websiteSettings,
                                                 websiteSettings);

            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);


            //            GlobalConfiguration.Configuration.Formatters.Clear();
            //            GlobalConfiguration.Configuration.Formatters.Add(new JsonMediaTypeFormatter());
        }
 public Deployment()
 {
     //the object constructors below init their internal properties as well...
     this.AppPool = new AppPoolSettings();
     this.Site    = new WebSiteSettings();
 }