private static UrlBuilderParam ParseDic(Dictionary <string, List <string> > dic) { UrlBuilderParam UrlBuilderParam = new UrlBuilderParam(); foreach (var item in dic) { var type = Gdp.Utils.EnumUtil.TryParse <UrlBuildParamType>(item.Key); var listVal = item.Value; switch (type) { case UrlBuildParamType._: break; case UrlBuildParamType.B: break; case UrlBuildParamType.UrlModels: UrlBuilderParam.UrlModels = listVal; break; case UrlBuildParamType.UrlDirectories: UrlBuilderParam.UrlDirectories = listVal; break; case UrlBuildParamType.Source: UrlBuilderParam.Source = listVal; break; case UrlBuildParamType.IntervalSecond: UrlBuilderParam.IntervalSecond = (int)int.Parse(listVal[0]); break; case UrlBuildParamType.StartTime: UrlBuilderParam.StartTime = Time.Parse(listVal.ToArray()); break; case UrlBuildParamType.EndTime: UrlBuilderParam.EndTime = Time.Parse(listVal.ToArray()); break; case UrlBuildParamType.ProductType: UrlBuilderParam.ProductType = (IgsProductType)Enum.Parse(typeof(IgsProductType), listVal[0]); break; case UrlBuildParamType.OutputPath: UrlBuilderParam.OutputPath = (listVal[0]); break; default: log.Warn(type + " Not implemented "); break; } } return(UrlBuilderParam); }
private static void BuildUrls(string[] args) { var urlBuilderParam = UrlBuilderParam.ParseArgs(args); var pathBuilder = new IgsProductUrlPathBuilder( urlBuilderParam.UrlDirectories.ToArray(), urlBuilderParam.UrlModels.ToArray(), urlBuilderParam.Source.ToArray(), urlBuilderParam.StartTime.DateTime, urlBuilderParam.EndTime.DateTime, urlBuilderParam.ProductType, urlBuilderParam.IntervalSecond); var pathes = pathBuilder.Build(); File.WriteAllLines(urlBuilderParam.OutputPath, pathes); }