Exemplo n.º 1
0
        /// <summary>
        /// Tries to resolve the name of the paragraph from
        /// a xml comment line by removing the prefix identifier and potential
        /// additional information.
        /// </summary>
        /// <param name="name">Header line of the xml comment based help paragraph</param>
        /// <returns>Name of the paragraph without prefix and additional information</returns>
        private static string GetNameFromLine(string name)
        {
            XmlHelperKeywordRegex keywordRegex = XmlHelpKeywordRegexBuilder.Create(HelpKeywordPrefixIdentifier);
            Match keywordRegexMatch            = keywordRegex.RegexObject.Match(name);

            return(keywordRegexMatch.Success ? keywordRegexMatch.Groups[keywordRegex.KeywordGroupName].Value : name);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Tries to resolve the additional content from
        /// a xml comment based line by removing the prefix identifier and
        /// the name of the paragraph
        /// </summary>
        /// <param name="name">Header line of the xml comment based help paragraph</param>
        /// <returns>Additional information without prefix and header title</returns>
        private static string GetAdditionalInformationFromLine(string name)
        {
            XmlHelperKeywordRegex keywordRegex = XmlHelpKeywordRegexBuilder.Create(HelpKeywordPrefixIdentifier);
            Match keywordRegexMatch            = keywordRegex.RegexObject.Match(name);

            return(keywordRegexMatch.Groups[keywordRegex.AdditionalGroupName].Success ?
                   keywordRegexMatch.Groups[keywordRegex.AdditionalGroupName].Value : String.Empty);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Checks if a given line is a xml comment based paragraph header title keyword.
 /// </summary>
 /// <param name="text">Line to check</param>
 /// <returns>True if it is a keyword.</returns>
 public static bool IsKeyword(string text)
 {
     return(XmlHelpKeywordRegexBuilder.Create(HelpKeywordPrefixIdentifier).RegexObject.IsMatch(text.Trim()));
 }