/// <summary> /// 域名服务 /// </summary> protected Server() { WebConfig = getWebConfig() ?? AutoCSer.WebView.Config.Null.Default; #if !MONO WebConfigIgnoreCase = WebConfig.IgnoreCase; #endif #if !DOTNET2 && !DOTNET4 WebConfigIsFastestCompressionLevel = WebConfig.IsFastestCompressionLevel; #endif }
/// <summary> /// 代码生成入口 /// </summary> /// <param name="parameter">安装参数</param> /// <returns>是否生成成功</returns> public bool Run(ProjectParameter parameter) { if ((WebConfig = parameter.WebConfig) != null && WebConfig.IsWebView) { this.Parameter = parameter; Type exportPathType = WebConfig.ExportPathType; if (exportPathType != null) { DirectoryInfo viewDirectory = new DirectoryInfo(parameter.ProjectPath + WebConfig.ViewJsDirectory + Path.DirectorySeparatorChar); if (viewDirectory.Exists) { string webPathFileName = viewDirectory.fullName() + "WebPath"; if (!(WebConfig.IsExportPathTypeScript ? TemplateGenerator.WebPath.TypeScript.Default.Run(exportPathType, webPathFileName) : TemplateGenerator.WebPath.JavaScript.Default.Run(exportPathType, webPathFileName))) { Messages.Message("WEB Path 生成失败"); } } else { Messages.Message("没有找到 WEB 视图扩展默认目录 " + viewDirectory.FullName); } } if (WebConfig.IsCopyScript) { if (AutoCSerScriptPath == null) { Messages.Message("没有找到 js 文件路径"); } else { copyScript(); } } Htmls = DictionaryCreator.CreateHashString <HtmlJs>(); if (!HtmlJs.Create(this)) { return(false); } css(); File.WriteAllText(parameter.ProjectPath + AutoCSer.Net.Http.Header.VersionFileName, HtmlJs.Version, System.Text.Encoding.ASCII); } return(true); }