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));
        }
示例#2
0
 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();
 }
示例#3
0
        public static XPCCoder Create(string virtualPath)
        {
            var code = PageUtil.GetRawCode(virtualPath);

            if (!XamlUtil.IsDeclareXaml(code))
            {
                return(null);
            }
            return(new XPCCoder(virtualPath));
        }
示例#4
0
        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));
        }
示例#5
0
 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();
         }
     }
 }
示例#6
0
 private string GetRawCode()
 {
     return(PageUtil.GetRawCode(this.VirtualPath));
 }