예제 #1
0
        IClassificationType GetClassificationTypeForMarkdownToken(MarkdownParser.TokenType tokenType)
        {
            int index = (int)tokenType;

            if (index < 0 || index >= _tokenToClassificationType.Length || _tokenToClassificationType[index] == null)
            {
                throw new ArgumentException("Unable to find classification type for " + tokenType.ToString(), "tokenType");
            }

            return(_tokenToClassificationType[index]);
        }
예제 #2
0
        IClassificationType GetClassificationTypeForMarkdownToken(MarkdownParser.TokenType tokenType)
        {
            string classificationType;

            if (!_tokenToClassificationType.TryGetValue(tokenType, out classificationType))
            {
                throw new ArgumentException("Unable to find classification type for " + tokenType.ToString(), "tokenType");
            }

            return(_classificationRegistry.GetClassificationType(classificationType));
        }