本文整理汇总了C#中ICSharpCode.XmlEditor.XmlElementPath.AddElement方法的典型用法代码示例。如果您正苦于以下问题:C# XmlElementPath.AddElement方法的具体用法?C# XmlElementPath.AddElement怎么用?C# XmlElementPath.AddElement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICSharpCode.XmlEditor.XmlElementPath
的用法示例。
在下文中一共展示了XmlElementPath.AddElement方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FixtureInit
public override void FixtureInit()
{
XmlElementPath path = new XmlElementPath();
path.AddElement(new QualifiedName("schema", "http://www.w3.org/2001/XMLSchema"));
schemaChildElements = SchemaCompletion.GetChildElementCompletion(path);
schemaAttributes = SchemaCompletion.GetAttributeCompletion(path);
// Get include elements attributes.
path.AddElement(new QualifiedName("include", "http://www.w3.org/2001/XMLSchema"));
includeAttributes = SchemaCompletion.GetAttributeCompletion(path);
// Get annotation element info.
path.Elements.RemoveLast();
path.AddElement(new QualifiedName("annotation", "http://www.w3.org/2001/XMLSchema"));
annotationChildElements = SchemaCompletion.GetChildElementCompletion(path);
annotationAttributes = SchemaCompletion.GetAttributeCompletion(path);
// Get app info attributes.
path.AddElement(new QualifiedName("appinfo", "http://www.w3.org/2001/XMLSchema"));
appInfoAttributes = SchemaCompletion.GetAttributeCompletion(path);
// Get foo attributes.
path = new XmlElementPath();
path.AddElement(new QualifiedName("foo", "http://www.w3.org/2001/XMLSchema"));
fooAttributes = SchemaCompletion.GetAttributeCompletion(path);
}
示例2: Init
public void Init()
{
XmlElementPath path = new XmlElementPath();
path.AddElement(new QualifiedName("a", "a-namespace"));
path.AddElement(new QualifiedName("b", "b-namespace"));
paths = new XmlElementPathsByNamespace(path);
}
示例3: FixtureInit
public override void FixtureInit()
{
XmlElementPath path = new XmlElementPath();
path.AddElement(new QualifiedName("root", "http://foo"));
path.AddElement(new QualifiedName("bar", "http://foo"));
barElementAttributes = SchemaCompletion.GetAttributeCompletion(path);
}
示例4: TextHasNoChildElements
public void TextHasNoChildElements()
{
XmlElementPath path = new XmlElementPath();
path.AddElement(new QualifiedName("note", "http://www.w3schools.com"));
path.AddElement(new QualifiedName("text", "http://www.w3schools.com"));
Assert.AreEqual(0, SchemaCompletion.GetChildElementCompletion(path).Count,
"Should be no child elements.");
}
示例5: Equality
public void Equality()
{
XmlElementPath newPath = new XmlElementPath();
newPath.AddElement(new QualifiedName("foo", "http://foo", "f"));
newPath.AddElement(new QualifiedName("bar", "http://bar", "b"));
Assert.IsTrue(newPath.Equals(path), "Should be equal.");
}
示例6: NotEqual
public void NotEqual()
{
XmlElementPath newPath = new XmlElementPath();
newPath.AddElement(new QualifiedName("aaa", "a", "a"));
newPath.AddElement(new QualifiedName("bbb", "b", "b"));
Assert.IsFalse(newPath.Equals(path), "Should not be equal.");
}
示例7: FirstXmlElementPathHasTwoElements
public void FirstXmlElementPathHasTwoElements()
{
XmlElementPath expectedPath = new XmlElementPath();
expectedPath.AddElement(new QualifiedName("a", "a-namespace"));
expectedPath.AddElement(new QualifiedName("aa", "a-namespace"));
Assert.AreEqual(expectedPath, paths[0]);
}
示例8: FixtureInit
public override void FixtureInit()
{
XmlElementPath path = new XmlElementPath();
path.AddElement(new QualifiedName("project", "http://nant.sf.net//nant-0.84.xsd"));
path.AddElement(new QualifiedName("attrib", "http://nant.sf.net//nant-0.84.xsd"));
attributes = SchemaCompletion.GetAttributeCompletion(path);
}
示例9: Init
public void Init()
{
path = new XmlElementPath();
firstQualifiedName = new QualifiedName("foo", "http://foo", "f");
path.AddElement(firstQualifiedName);
secondQualifiedName = new QualifiedName("bar", "http://bar", "b");
path.AddElement(secondQualifiedName);
}
示例10: FixtureInit
public override void FixtureInit()
{
XmlElementPath path = new XmlElementPath();
path.AddElement(new QualifiedName("person", "http://foo"));
personElementChildren = SchemaCompletion.GetChildElementCompletion(path);
path.AddElement(new QualifiedName("firstname", "http://foo"));
firstNameAttributes = SchemaCompletion.GetAttributeCompletion(path);
firstNameElementChildren = SchemaCompletion.GetChildElementCompletion(path);
}
示例11: GetActiveElementStartPathForChildElementWithNamespacePrefix
public void GetActiveElementStartPathForChildElementWithNamespacePrefix()
{
string text = "<f:foo xmlns:f='" + namespaceURI + "' ><f:bar ";
elementPath = XmlParser.GetActiveElementStartPath(text, text.Length);
expectedElementPath = new XmlElementPath();
expectedElementPath.AddElement(new QualifiedName("foo", namespaceURI, "f"));
expectedElementPath.AddElement(new QualifiedName("bar", namespaceURI, "f"));
Assert.IsTrue(expectedElementPath.Equals(elementPath),
"Incorrect active element path.");
}
示例12: GetParentElementPathForTwoElementsInDifferentNamespaces
public void GetParentElementPathForTwoElementsInDifferentNamespaces()
{
string text = "<bar xmlns='http://test.com'><foo xmlns='" + namespaceURI + "' ><";
elementPath = XmlParser.GetParentElementPath(text);
expectedElementPath = new XmlElementPath();
expectedElementPath.AddElement(new QualifiedName("bar", "http://test.com"));
expectedElementPath.AddElement(new QualifiedName("foo", namespaceURI));
Assert.IsTrue(elementPath.Equals(expectedElementPath),
"Incorrect active element path.");
}
示例13: XmlElementPath
public void GetAttributeCompletion_TemplateElementIsChildOfStylesheetElement_SubstitutionGroupUsedForTemplateAndMatchAttributeReturned()
{
var path = new XmlElementPath();
path.AddElement(new QualifiedName("stylesheet", namespaceURI));
path.AddElement(new QualifiedName("template", namespaceURI));
XmlCompletionItemCollection completionItems = schemaCompletion.GetAttributeCompletion(path);
bool contains = completionItems.Contains("match");
Assert.IsTrue(contains);
}
示例14: PathTest3
public void PathTest3()
{
string text = "<foo xmlns='" + namespaceURI + "'><bar>";
elementPath = XmlParser.GetActiveElementStartPathAtIndex(text, text.IndexOf("ar>"));
expectedElementPath = new XmlElementPath();
expectedElementPath.AddElement(new QualifiedName("foo", namespaceURI));
expectedElementPath.AddElement(new QualifiedName("bar", namespaceURI));
Assert.IsTrue(elementPath.Equals(expectedElementPath),
"Incorrect active element path.");
}
示例15: FixtureInit
public override void FixtureInit()
{
XmlElementPath path = new XmlElementPath();
path.AddElement(new QualifiedName("html", "http://foo/xhtml"));
path.AddElement(new QualifiedName("body", "http://foo/xhtml"));
childElements = SchemaCompletion.GetChildElementCompletion(path);
path.AddElement(new QualifiedName("p", "http://foo/xhtml"));
paraAttributes = SchemaCompletion.GetAttributeCompletion(path);
}