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


C# Element.FindElement方法代码示例

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


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

示例1: GetElementPrivate

 private static Element GetElementPrivate(List<string> steps, Element element)
 {
     if (steps.Count > 0)
     {
         string step = steps[0];
         steps.RemoveAt(0);
         return GetElementPrivate(steps, element.FindElement(step));
     }
     else
     {
         return element;
     }
 }
开发者ID:jaffinito,项目名称:dotnet_configuration,代码行数:13,代码来源:ElementExtensions.cs

示例2: PreFormatMerge

        private void PreFormatMerge(Element xsdElement, Element mergeElement, Element mergeParent)
        {
            mergeElement.Parent = mergeParent;

            foreach (var attribute in xsdElement.Attributes)
            {
                mergeElement.Attributes.Add(attribute.Clone());
            }

            foreach (var child in xsdElement.Elements)
            {
                mergeElement.Elements.Add(child.Clone());
                PreFormatMerge(child, mergeElement.FindElement(child.Name), mergeElement);
            }
        }
开发者ID:jaffinito,项目名称:dotnet_configuration,代码行数:15,代码来源:ConfigMerge.cs

示例3: RemoveFirst_TwoMatching

        public void RemoveFirst_TwoMatching()
        {
            Element element = new Element();
            element.MaxOccurs = 1;
            element.MinOccurs = 0;
            element.Name = "baseElement";
            element.Parent = null;
            element.RootElement = true;
            element.SpecialLength = false;
            element.Type = "DataType.String";
            element.Value = "baseElement";
            element.Documentation = "baseElement";
            element.IsAdvanced = true;

            Element element2 = new Element();
            element2.MaxOccurs = 1;
            element2.MinOccurs = 0;
            element2.Name = "element2";
            element2.Parent = element;
            element2.RootElement = true;
            element2.SpecialLength = false;
            element2.Type = "DataType.String";
            element2.Value = "element2";
            element2.Documentation = "element2";
            element2.IsAdvanced = true;

            element.Elements.Add(element2);

            Element element3 = new Element();
            element3.MaxOccurs = 1;
            element3.MinOccurs = 0;
            element3.Name = "element3";
            element3.Parent = element;
            element3.RootElement = true;
            element3.SpecialLength = false;
            element3.Type = "DataType.String";
            element3.Value = "element3";
            element3.Documentation = "element3";
            element3.IsAdvanced = true;

            element.Elements.Add(element3);

            Element element2a = new Element();
            element2a.MaxOccurs = 1;
            element2a.MinOccurs = 0;
            element2a.Name = "element2";
            element2a.Parent = element;
            element2a.RootElement = true;
            element2a.SpecialLength = false;
            element2a.Type = "DataType.String";
            element2a.Value = "element2a";
            element2a.Documentation = "element2a";
            element2a.IsAdvanced = true;

            element.Elements.Add(element2a);

            element.RemoveFirst("element2");

            Assert.IsTrue(element.FindElement("element2").Value == "element2a");
        }
开发者ID:jaffinito,项目名称:dotnet_configuration,代码行数:60,代码来源:ElementTests.cs

示例4: FindElement_Success

        public void FindElement_Success()
        {
            Element element = new Element();
            element.MaxOccurs = 1;
            element.MinOccurs = 0;
            element.Name = "baseElement";
            element.Parent = null;
            element.RootElement = true;
            element.SpecialLength = false;
            element.Type = "DataType.String";
            element.Value = "baseElement";
            element.Documentation = "baseElement";
            element.IsAdvanced = true;

            Element element2 = new Element();
            element2.MaxOccurs = 1;
            element2.MinOccurs = 0;
            element2.Name = "element2";
            element2.Parent = element;
            element2.RootElement = true;
            element2.SpecialLength = false;
            element2.Type = "DataType.String";
            element2.Value = "element2";
            element2.Documentation = "element2";
            element2.IsAdvanced = true;

            element.Elements.Add(element2);

            Assert.IsTrue(element2.Name == element.FindElement("element2").Name);
        }
开发者ID:jaffinito,项目名称:dotnet_configuration,代码行数:30,代码来源:ElementTests.cs

示例5: PrePopulateMergedFileInternal

        private void PrePopulateMergedFileInternal(Element schemaElement, Element mergeElement, Element mergeParent)
        {
            try
            {
                mergeElement.Parent = mergeParent;

                foreach (var attribute in schemaElement.Attributes)
                {
                    mergeElement.Attributes.Add(attribute.Clone());
                }

                foreach (var child in schemaElement.Elements)
                {
                    mergeElement.Elements.Add(child.Clone());
                    PrePopulateMergedFileInternal(child, mergeElement.FindElement(child.Name), mergeElement);
                }
            }
            catch (Exception ex)
            {
                log.Debug(ex);
            }
        }
开发者ID:jaffinito,项目名称:dotnet_configuration,代码行数:22,代码来源:MergeProcessor.cs


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