本文整理汇总了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;
}
}
示例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);
}
}
示例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");
}
示例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);
}
示例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);
}
}