/// <summary> /// 构建 /// </summary> /// <param name="time"></param> /// <returns></returns> public string [] Build(Time time) { var urlModels = BuildWithUrlDirectory(new List <String>(UrlModels)); urlModels = BuildWithProductType(urlModels); urlModels = ELMarkerReplaceService.BuildWithTime(urlModels, time); urlModels = BuildWithSourceName(urlModels); urlModels = BuildWithSiteNames(urlModels); urlModels = RemoveRedundancy(urlModels); return(urlModels.ToArray()); }
private void button_gen_urls_Click(object sender, EventArgs e) { string urlModel = this.textBox1_uriModel.Text; DateTime timeFrom = timePeriodControl1.TimePeriod.StartDateTime; //.TimeFrom; DateTime timeTo = this.timePeriodControl1.TimePeriod.EndDateTime; //.TimeTo; var daySpan = TimeSpan.FromDays(1); List <string> urls = ELMarkerReplaceService.BuildWithTime(urlModel, timeFrom, timeTo, TimeSpan.FromDays(1)); this.richTextBoxControl1.Lines = urls.ToArray(); log.Info("生成 " + urls.Count + " 条地址。"); }
private List <string> BuildWithTime(List <string> urlModels) { Time from = Time.Parse(TimeFrom); Time to = Time.Parse(TimeTo); List <string> pathes = new List <string>(); for (Time ifrom = from; ifrom <= to; ifrom = ifrom + TimeIntervalInSeconds) { List <string> subPathes = ELMarkerReplaceService.BuildWithTime(urlModels, ifrom); pathes.AddRange(subPathes); } return(pathes.Distinct().ToList()); }
private void button_gen_urls_Click(object sender, EventArgs e) { string urlModel = this.textBox1_uriModel.Text; DateTime timeFrom = timePeriodControl1.TimePeriod.StartDateTime; //.TimeFrom; DateTime timeTo = this.timePeriodControl1.TimePeriod.EndDateTime; //.TimeTo; string[] siteNames = namedStringControl_siteNames.GetValue().Split(new char[] { ',', ',', ' ' }, StringSplitOptions.RemoveEmptyEntries); var daySpan = TimeSpan.FromDays(1); List <string> urls = ELMarkerReplaceService.BuildWithTime(urlModel, timeFrom, timeTo, TimeSpan.FromDays(1)); urls = ELMarkerReplaceService.BuildWithKeys(urls, ELMarker.SiteName, siteNames); richTextBoxControl_allUrls.Lines = urls.ToArray(); var info = "生成 " + urls.Count + " 条数据。"; ShowInfo(info); Geo.Utils.FormUtil.ShowOkMessageBox(info); }