protected override string GetReplaceText(string virtualPath, Match mc) { GroupCollection gs = mc.Groups; string src = gs[1].Value; string srcVirtualPath = PageUtil.MapVirtualPath(virtualPath, src); string code = PageUtil.GetRawCode(srcVirtualPath); return(ContinueReplace(srcVirtualPath, code)); }
private XPCCoder(string virtualPath) { this.VirtualPath = virtualPath; this.SourcePath = GetSourceFileName(this.VirtualPath); this.GIPath = GetFileName(this.VirtualPath, "g.i."); this.GPath = GetFileName(this.VirtualPath, "g."); this.UserPath = GetFileName(this.VirtualPath, null); this.PageCode = PageUtil.GetRawCode(virtualPath); InitCode(); }
public static XPCCoder Create(string virtualPath) { var code = PageUtil.GetRawCode(virtualPath); if (!XamlUtil.IsDeclareXaml(code)) { return(null); } return(new XPCCoder(virtualPath)); }
private static string GetCode(string virtualPath) { GenerateCode(virtualPath, false); string fileName = GetCodeFileName(virtualPath); if (File.Exists(fileName)) { return(BuildProviderUtil.ReadCode(fileName)); } //不参与解析的代码,直接输出原始代码 return(PageUtil.GetRawCode(virtualPath)); }
public static void GenerateCode(string virtualPath, bool isRemoveCache) { if (!IsIgnore(virtualPath)) { string code = PageUtil.GetRawCode(virtualPath); var info = StaticParser.Parse(virtualPath, code); if (BuildProviderUtil.SaveCode(GetCodeFileName(virtualPath), info) && isRemoveCache) { RemoveCache(); } } }
private string GetRawCode() { return(PageUtil.GetRawCode(this.VirtualPath)); }