Exemplo n.º 1
0
        static string GetHighlightedFileContent(string virtualPath)
        {
            string filePath = GetHighlightedFilePath(virtualPath);
            string text     = File.ReadAllText(filePath);

            return(CodeFormatter.GetFormattedCode(Path.GetExtension(filePath), text, IsMvc, IsMvcRazor));
        }
Exemplo n.º 2
0
        static string DescriptionCodeReplacer(Match match)
        {
            string lang = match.Groups[1].Value.Trim('"', '\'');
            string code = match.Groups[2].Value;

            return("<code>" + CodeFormatter.GetFormattedCode(CodeFormatter.ParseLanguage(lang), code) + "<br /></code>");
        }
Exemplo n.º 3
0
        static string DescriptionCodeReplacer(Match match)
        {
            string lang   = match.Groups[1].Value.Trim('"', '\'');
            string code   = match.Groups[2].Value;
            string result = "<code>" + CodeFormatter.GetFormattedCode(CodeFormatter.ParseLanguage(lang), code, Utils.IsMvc, new string[0]) + "<br /></code>";

            return(Utils.IsOverview ? string.Format("<div class='{0}'>{1}</div>", "CodeBlock", result) : result);
        }
Exemplo n.º 4
0
        static string GetHighlightedFileContent(string virtualPath, string[] highlightedTagNames, bool isResource)
        {
            string text     = string.Empty;
            string filePath = virtualPath;

            if (!isResource)
            {
                filePath = GetHighlightedFilePath(virtualPath);
                text     = File.ReadAllText(filePath);
            }
            else
            {
                var resourceManager = new System.Resources.ResourceManager(ResourseFilePath, Assembly.GetExecutingAssembly());
                text = resourceManager.GetString(virtualPath);
            }
            return(CodeFormatter.GetFormattedCode(Path.GetExtension(filePath.Replace("_", ".")), text, IsMvc, highlightedTagNames));
        }