Beispiel #1
0
        /// <summary>
        /// Applies a fall back strategy by using the given text as the default
        /// help paragraph section.
        /// </summary>
        /// <param name="helpText">The help text to apply the fallback on</param>
        /// <param name="keywords">Parsed help</param>
        private void ApplyFallBackStrategy(string helpText, IXmlHelp keywords)
        {
            IXmlCommentHelpParagraph fallBackParagraph = GetFallbackDescription(helpText);

            if (fallBackParagraph != null)
            {
                keywords.Add(fallBackParagraph);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Parses the given text and returns an object implementing
        /// the <see cref="IXmlHelp"/> interface representing the text
        /// based help.
        /// </summary>
        /// <param name="help">Help text lines to parse</param>
        /// <returns>Parsed help</returns>
        public IXmlHelp Parse(IList <string> help)
        {
            IXmlHelp keywords = DoParseXmlHelp(help);

            if (keywords.Count == 0)
            {
                ApplyFallBackStrategy(string.Join('\n', help), keywords);
            }
            return(keywords);
        }
Beispiel #3
0
        public IMsBuildElementHelp Convert(IXmlHelp xmlHelp)
        {
            IMsBuildElementHelp msBuildElementHelp = new MsBuildElementHelp();
            XmlHelpParagraphToMsBuildElementHelpParagraphConverter converter =
                new XmlHelpParagraphToMsBuildElementHelpParagraphConverter();

            foreach (var xmlHelpParagraph in xmlHelp)
            {
                msBuildElementHelp.Add(converter.Convert(xmlHelpParagraph));
            }

            return(msBuildElementHelp);
        }
Beispiel #4
0
        public static IMsBuildElementHelp ToMsBuildElementHelp(this IXmlHelp xmlHelp)
        {
            XmlHelpToMsBuildElementHelpConverter converter = new XmlHelpToMsBuildElementHelpConverter();

            return(converter.Convert(xmlHelp));
        }