private void StartProject() { var dict = GetAvailableSites(); if (dict == null || dict.Count == 0) { MessageBox.Show(@"Please input Urls.", Constants.ApplicationTitle); return; } if (dict.Any(e => !e.Value.IsValid)) { var count = dict.Count(e => !e.Value.IsValid); MessageBox.Show( count == 1 ? @"There is a invalid url or size, please check it." : string.Format("There are {0} invalid urls or sizes, please check them.", count), Constants.ApplicationTitle); return; } btnStart.Enabled = false; btnStop.Enabled = true; btnReadFile.Enabled = false; txtChampUrl.BackColor = DefaultBackColor; txtEastbayUrl.BackColor = DefaultBackColor; txtFootactionUrl.BackColor = DefaultBackColor; txtFootLockerUrl.BackColor = DefaultBackColor; ShowHideMultiTabPages(false, tabChampsSports, tabEastbay, tabFootaction, tabFootLocker); _dictStopTracking = new Dictionary <SiteType, bool>(); if (dict.Any(site => site.Value != null && site.Value.IsPageModel())) { _uiLogging.Write("Start Project"); StartMultiSites(dict); } }
public void Run() { StopFlage = false; int intervalBySecond = Constants.DefaultSimulatorWaitingTime; _simulatorView.PrepareDocument(); _simulatorView.SetTimerInterval(intervalBySecond); _spiderLogging.Write(string.Format("{0} - {1}", _pageModel.Type, MethodBase.GetCurrentMethod().Name)); _url = FakeUrl(); StartSimulatorView(_url); }