Example #1
0
 private static XElement CreateOutput(MamlInputOutput output)
 {
     return(new XElement(commandNS + "returnValue",
                         new XElement(devNS + "type",
                                      new XElement(mamlNS + "name", output.TypeName)),
                         new XElement(mamlNS + "description", GenerateParagraphs(output.Description))));
 }
Example #2
0
        private void AddInputOutput(int levelRoot, MamlInputOutput io, bool noFormatForInputOutput)
        {
            if (string.IsNullOrEmpty(io.TypeName) && string.IsNullOrEmpty(io.Description))
            {
                // in this case ignore
                return;
            }

            var extraNewLine = ShouldBreak(io.FormatOption);

            if (noFormatForInputOutput)
            {
                if (!string.IsNullOrWhiteSpace(io.TypeName))
                {
                    AddParagraphs(io.TypeName, false, true);
                }
                if (!string.IsNullOrWhiteSpace(io.Description))
                {
                    AddParagraphs(io.Description, false, true);
                }
            }
            else
            {
                AddHeader(levelRoot, ModelTransformerBase.INPUT_OUTPUT_TYPENAME_HEADING_LEVEL, io.TypeName, extraNewLine);
                AddParagraphs(io.Description);
            }
        }
Example #3
0
 private static YamlInputOutput CreateInputOutput(MamlInputOutput mamlInputOutput)
 {
     return(new YamlInputOutput
     {
         Description = mamlInputOutput.Description,
         Type = mamlInputOutput.TypeName
     });
 }
Example #4
0
        private void AddInputOutput(MamlInputOutput io)
        {
            if (string.IsNullOrEmpty(io.TypeName) && string.IsNullOrEmpty(io.Description))
            {
                // in this case ignore
                return;
            }

            var extraNewLine = string.IsNullOrEmpty(io.Description);
            AddHeader(ModelTransformerBase.INPUT_OUTPUT_TYPENAME_HEADING_LEVEL, io.TypeName, extraNewLine);
            AddParagraphs(io.Description);
        }
Example #5
0
        protected MamlInputOutput InputOutputRule()
        {
            // grammar:
            // #### TypeName
            // Description
            var node        = GetNextNode();
            var headingNode = GetHeadingWithExpectedLevel(node, INPUT_OUTPUT_TYPENAME_HEADING_LEVEL);

            if (headingNode == null)
            {
                return(null);
            }

            MamlInputOutput typeEntity = new MamlInputOutput()
            {
                TypeName = headingNode.Text
            };

            typeEntity.Description = SimpleTextSectionRule();

            return(typeEntity);
        }