当前位置: 首页>>代码示例>>C#>>正文


C# XmlNode.AddElement方法代码示例

本文整理汇总了C#中XmlNode.AddElement方法的典型用法代码示例。如果您正苦于以下问题:C# XmlNode.AddElement方法的具体用法?C# XmlNode.AddElement怎么用?C# XmlNode.AddElement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XmlNode的用法示例。


在下文中一共展示了XmlNode.AddElement方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddToXml

        /// <summary>
        /// Returns an XmlNode representing the current result after
        /// adding it as a child of the supplied parent node.
        /// </summary>
        /// <param name="parentNode">The parent node.</param>
        /// <param name="recursive">If true, descendant results are included</param>
        /// <returns></returns>
        public override XmlNode AddToXml(XmlNode parentNode, bool recursive)
        {
            XmlNode thisNode = parentNode.AddElement(XmlElementName);

            PopulateTestNode(thisNode, recursive);

            thisNode.AddAttribute("seed", this.Seed.ToString());

            return thisNode;
        }
开发者ID:balaghanta,项目名称:nunit-framework,代码行数:17,代码来源:TestMethod.cs

示例2: AddToXml

        /// <summary>
        /// Returns an XmlNode representing the PropertyBag after
        /// adding it as a child of the supplied parent node.
        /// </summary>
        /// <param name="parentNode">The parent node.</param>
        /// <param name="recursive">Not used</param>
        /// <returns></returns>
        public XmlNode AddToXml(XmlNode parentNode, bool recursive)
        {
            XmlNode properties = parentNode.AddElement("properties");

            foreach (string key in Keys)
            {
                foreach (object value in this[key])
                {
                    XmlNode prop = properties.AddElement("property");

                    // TODO: Format as string
                    prop.AddAttribute("name", key.ToString());
                    prop.AddAttribute("value", value.ToString());
                }
            }

            return properties;
        }
开发者ID:haf,项目名称:nunit-framework,代码行数:25,代码来源:PropertyBag.cs

示例3: AddToXml

        /// <summary>
        /// Returns an XmlNode representing the current result after
        /// adding it as a child of the supplied parent node.
        /// </summary>
        /// <param name="parentNode">The parent node.</param>
        /// <param name="recursive">If true, descendant results are included</param>
        /// <returns></returns>
        public override XmlNode AddToXml(XmlNode parentNode, bool recursive)
        {
            XmlNode thisNode = parentNode.AddElement("test-suite");
            thisNode.AddAttribute("type", this.TestType);

			PopulateTestNode(thisNode, recursive);
            thisNode.AddAttribute("testcasecount", this.TestCaseCount.ToString());


            if (recursive)
                foreach (Test test in this.Tests)
                    test.AddToXml(thisNode, recursive);

            return thisNode;
        }
开发者ID:haf,项目名称:nunit-framework,代码行数:22,代码来源:TestSuite.cs

示例4: AddOutputElement

        private XmlNode AddOutputElement(XmlNode targetNode)
        {
            XmlNode outputNode = targetNode.AddElement("output");
            outputNode.TextContent = this.Output;

            return outputNode;
        }
开发者ID:balaghanta,项目名称:nunit-framework,代码行数:7,代码来源:TestResult.cs

示例5: AddFailureElement

        /// <summary>
        /// Adds a failure element to a node and returns it.
        /// </summary>
        /// <param name="targetNode">The target node.</param>
        /// <returns>The new failure element.</returns>
        private XmlNode AddFailureElement(XmlNode targetNode)
        {
            XmlNode failureNode = targetNode.AddElement("failure");

            if (this.Message != null)
            {
                failureNode.AddElement("message").TextContent = this.Message;
            }

            if (this.StackTrace != null)
            {
                failureNode.AddElement("stack-trace").TextContent = this.StackTrace;
            }

            return failureNode;
        }
开发者ID:balaghanta,项目名称:nunit-framework,代码行数:21,代码来源:TestResult.cs

示例6: AddReasonElement

 /// <summary>
 /// Adds a reason element to a node and returns it.
 /// </summary>
 /// <param name="targetNode">The target node.</param>
 /// <returns>The new reason element.</returns>
 private XmlNode AddReasonElement(XmlNode targetNode)
 {
     XmlNode reasonNode = targetNode.AddElement("reason");
     reasonNode.AddElement("message").TextContent = this.Message;
     return reasonNode;
 }
开发者ID:balaghanta,项目名称:nunit-framework,代码行数:11,代码来源:TestResult.cs

示例7: AddToXml

        /// <summary>
        /// Returns an XmlNode representing the current object after
        /// adding it as a child of the supplied parent node.
        /// </summary>
        /// <param name="parentNode">The parent node.</param>
        /// <param name="recursive">If true, children are included, where applicable</param>
        /// <returns></returns>
        public XmlNode AddToXml(XmlNode parentNode, bool recursive)
        {
            XmlNode thisNode = parentNode.AddElement("output");
            thisNode.AddAttribute("type", this.Type.ToString());
            thisNode.AddAttribute("text", this.Text);

            return thisNode;
        }
开发者ID:jeme,项目名称:nunit-framework,代码行数:15,代码来源:TestOutput.cs


注:本文中的XmlNode.AddElement方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。