Esempio n. 1
0
        static TokenCollection GetTokens(TokenLanguage language, string code, bool isMvc, bool isRazor)
        {
            switch (language)
            {
            case TokenLanguage.CSharp:
                return(CSharpTokensHelper.GetTokens(code));

            case TokenLanguage.Basic:
                return(VBTokensHelper.GetTokens(code));

            case TokenLanguage.JavaScript:
                return(JavaScriptTokensHelper.GetTokens(code));

            case TokenLanguage.Html:
                if (!isMvc)
                {
                    return(HtmlTokensHelper.GetTokens(code));
                }
                return(HtmlTokensHelper.GetTokens(code, isRazor ? LanguageKind.Razor : LanguageKind.Html, DotNetLanguageType.CSharp));

            case TokenLanguage.Xml:
                return(new XmlTokensCategoryHelper().GetTokens(code));

            case TokenLanguage.Css:
                return(new CssTokensCategoryHelper().GetTokens(code));

            default:
                return(null);
            }
        }
Esempio n. 2
0
 public string GetClassName(TokenLanguage language)
 {
     if (this.languagesClassNames.ContainsKey(language))
     {
         return(this.languagesClassNames[language]);
     }
     return(this.className);
 }
Esempio n. 3
0
 public static string GetFormattedCode(TokenLanguage language, string code, bool isMvc, string[] highlightedTagNames)
 {
     DevExpress.CodeParser.TokenCollection tokens = GetTokens(language, code, isMvc);
     if (tokens != null)
     {
         return(GetFormattedCode(language, code, tokens, highlightedTagNames));
     }
     return(string.Empty);
 }
Esempio n. 4
0
        public static string GetFormattedCode(TokenLanguage language, string code, bool isMvc)
        {
            var tokens = GetTokens(language, code, isMvc);

            if (tokens != null)
            {
                return(GetFormattedCode(code, tokens));
            }
            return(string.Empty);
        }
Esempio n. 5
0
        public static string GetFormattedCode(TokenLanguage language, string code, bool isMvc, bool isRazor)
        {
            TokenCollection tokens = GetTokens(language, code, isMvc, isRazor);

            if (tokens != null)
            {
                return(GetFormattedCode(code, tokens));
            }
            return(string.Empty);
        }
Esempio n. 6
0
 static string GetFormattedCode(TokenLanguage language, string code, DevExpress.CodeParser.TokenCollection tokens, string[] highlightedTagNames)
 {
     if ((int)language == (int)TokenLanguage.Html && highlightedTagNames.Length != 0 && HasHighlightedTagsOnPage(tokens, highlightedTagNames) || HasHighlightedCodeBlockMarker(code))
     {
         return(GetFormattedAspxCode(code, tokens, highlightedTagNames));
     }
     else
     {
         return(GetFormattedOtherCode(code, tokens, highlightedTagNames));
     }
 }
Esempio n. 7
0
 public string GetClassName(TokenLanguage language)
 {
     return(_languagesClassNames.ContainsKey(language) ? _languagesClassNames[language] : _className);
 }
Esempio n. 8
0
 static string GetFormattedCode(TokenLanguage language, string code, DevExpress.CodeParser.TokenCollection tokens, string[] highlightedTagNames) {
     if((int)language == (int)TokenLanguage.Html && highlightedTagNames.Length != 0 && HasHighlightedTagsOnPage(tokens, highlightedTagNames) || HasHighlightedCodeBlockMarker(code))
         return GetFormattedAspxCode(code, tokens, highlightedTagNames);
     else
         return GetFormattedOtherCode(code, tokens, highlightedTagNames);
 }
Esempio n. 9
0
 public static string GetFormattedCode(TokenLanguage language, string code)
 {
     return(GetFormattedCode(language, code, false, false));
 }
Esempio n. 10
0
 public string GetClassName(TokenLanguage language) {
     return languagesClassNames.ContainsKey(language) ? languagesClassNames[language] : className;
 }
Esempio n. 11
0
 static TokenCollection GetTokens(TokenLanguage language, string code, bool isMvc, bool isRazor) {
     switch (language) {
         case TokenLanguage.CSharp:
             return CSharpTokensHelper.GetTokens(code);
         case TokenLanguage.Basic:
             return VBTokensHelper.GetTokens(code);
         case TokenLanguage.JavaScript:
             return JavaScriptTokensHelper.GetTokens(code);
         case TokenLanguage.Html:
             if (!isMvc)
                 return HtmlTokensHelper.GetTokens(code);
             return HtmlTokensHelper.GetTokens(code, isRazor ? LanguageKind.Razor : LanguageKind.Html, DotNetLanguageType.CSharp);
         case TokenLanguage.Xml:
             return new XmlTokensCategoryHelper().GetTokens(code);
         case TokenLanguage.Css:
             return new CssTokensCategoryHelper().GetTokens(code);
         default:
             return null;
     }
 }
Esempio n. 12
0
 public static string GetFormattedCode(TokenLanguage language, string code, bool isMvc, bool isRazor) {
     TokenCollection tokens = GetTokens(language, code, isMvc, isRazor);
     if (tokens != null)
         return GetFormattedCode(code, tokens);
     return string.Empty;
 }
Esempio n. 13
0
 public static string GetFormattedCode(TokenLanguage language, string code) {
     return GetFormattedCode(language, code, false, false);
 }
Esempio n. 14
0
 public static string GetFormattedCode(TokenLanguage language, string code, bool isMvc, string[] highlightedTagNames) {
     DevExpress.CodeParser.TokenCollection tokens = GetTokens(language, code, isMvc);
     if(tokens != null)
         return GetFormattedCode(language, code, tokens, highlightedTagNames);
     return string.Empty;
 }
Esempio n. 15
0
 public string GetClassName(TokenLanguage language) {
     if(this.languagesClassNames.ContainsKey(language))
         return this.languagesClassNames[language];
     return this.className;
 }
Esempio n. 16
0
 public static string GetFormattedCode(TokenLanguage language, string code, bool isMvc)
 {
     return(GetFormattedCode(language, code, isMvc, new string[0]));
 }
Esempio n. 17
0
 public static string GetFormattedCode(TokenLanguage language, string code, bool isMvc) {
     return GetFormattedCode(language, code, isMvc, new string[0]);
 }