本文整理汇总了C#中ICSharpCode.XmlEditor.QualifiedName类的典型用法代码示例。如果您正苦于以下问题:C# QualifiedName类的具体用法?C# QualifiedName怎么用?C# QualifiedName使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
QualifiedName类属于ICSharpCode.XmlEditor命名空间,在下文中一共展示了QualifiedName类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: HashCodeTest
public void HashCodeTest()
{
QualifiedName name1 = new QualifiedName("foo", "http://foo.com", "f");
XmlQualifiedName xmlQualifiedName = new XmlQualifiedName("foo", "http://foo.com");
Assert.AreEqual(name1.GetHashCode(), xmlQualifiedName.GetHashCode());
}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:7,代码来源:QualifiedNameTestFixture.cs
示例2: EqualsTest3
public void EqualsTest3()
{
QualifiedName name1 = new QualifiedName("foo", "http://foo.com", "f");
QualifiedName name2 = new QualifiedName("foo", "http://foo.com", "ggg");
Assert.IsTrue(name1 == name2, "Should be the same.");
}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:7,代码来源:QualifiedNameTestFixture.cs
示例3: NotEqualsTest2
public void NotEqualsTest2()
{
QualifiedName name1 = new QualifiedName("foo", "http://foo.com", "f");
QualifiedName name2 = null;
Assert.IsFalse(name1 == name2, "Should not be the same.");
}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:7,代码来源:QualifiedNameTestFixture.cs
示例4: SuccessTest8
public void SuccessTest8()
{
string text = "<a type='a";
QualifiedName expectedName = new QualifiedName("type", String.Empty);
QualifiedName name = XmlParser.GetQualifiedAttributeNameAtIndex(text, text.Length);
Assert.AreEqual(expectedName, name);
}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:7,代码来源:AttributeNameUnderCursorTests.cs
示例5: EqualsTest2
public void EqualsTest2()
{
QualifiedName name1 = new QualifiedName("foo", "http://foo.com", "f");
QualifiedName name2 = new QualifiedName("foo", "http://foo.com", "f");
Assert.AreEqual(name1, name2, "Should be the same.");
}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:7,代码来源:QualifiedNameTestFixture.cs
示例6: AttributeWithPrefix
public void AttributeWithPrefix()
{
string text = " a:test=";
QualifiedName expectedName = new QualifiedName("test", String.Empty, "a");
QualifiedName name = XmlParser.GetQualifiedAttributeName(text, text.Length);
Assert.AreEqual(expectedName, name);
}
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:7,代码来源:AttributeNameTestFixture.cs
示例7: AttributeNameWithPrefix2
public void AttributeNameWithPrefix2()
{
string text = "<a xab:test=";
QualifiedName expectedName = new QualifiedName("test", String.Empty, "xab");
QualifiedName name = XmlParser.GetQualifiedAttributeNameAtIndex(text, text.IndexOf("xa"));
Assert.AreEqual(expectedName, name);
}
开发者ID:BackupTheBerlios,项目名称:nantgui,代码行数:7,代码来源:AttributeNameUnderCursorTests.cs
示例8: SuccessTest5
public void SuccessTest5()
{
string text = "<a foo=";
QualifiedName expectedName = new QualifiedName("foo", String.Empty);
QualifiedName name = XmlParser.GetQualifiedAttributeNameAtIndex(text, 3);
Assert.AreEqual(expectedName, name);
}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:7,代码来源:AttributeNameUnderCursorTests.cs
示例9: SuccessTest6
public void SuccessTest6()
{
string text = " foo = '#";
QualifiedName expectedName = new QualifiedName("foo", String.Empty);
QualifiedName name = XmlParser.GetQualifiedAttributeName(text, text.Length);
Assert.AreEqual(expectedName, name, "Should have retrieved the attribute name 'foo'");
}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:7,代码来源:AttributeNameTestFixture.cs
示例10: CreateQualifiedNameCollectionInstanceUsingQualifiedNameCollection
public void CreateQualifiedNameCollectionInstanceUsingQualifiedNameCollection()
{
QualifiedName[] array = new QualifiedName[] { firstName, secondName };
QualifiedNameCollection oldCollection = new QualifiedNameCollection(array);
QualifiedNameCollection newCollection = new QualifiedNameCollection(oldCollection);
Assert.AreSame(firstName, newCollection[0]);
}
开发者ID:Erguotou,项目名称:SharpDevelop,代码行数:8,代码来源:QualifiedNameCollectionTests.cs
示例11: Init
public void Init()
{
firstName = new QualifiedName("first", "first-ns", "first-prefix");
secondName = new QualifiedName("second", "second-ns", "second-prefix");
QualifiedName[] array = new QualifiedName[] { firstName, secondName };
qualifiedNameCollection = new QualifiedNameCollection(array);
}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:8,代码来源:QualifiedNameCollectionTests.cs
示例12: 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);
}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:9,代码来源:TwoElementPathTestFixture.cs
示例13: FixtureInit
public override void FixtureInit()
{
// Note element path.
noteElementPath = new XmlElementPath();
QualifiedName noteQualifiedName = new QualifiedName("note", "http://www.w3schools.com");
noteElementPath.Elements.Add(noteQualifiedName);
// Text element path.
textElementPath = new XmlElementPath();
textElementPath.Elements.Add(noteQualifiedName);
textElementPath.Elements.Add(new QualifiedName("text", "http://www.w3schools.com"));
}
开发者ID:BackupTheBerlios,项目名称:nantgui,代码行数:12,代码来源:TwoElementSchemaTestFixture.cs
示例14: FixtureInit
public override void FixtureInit()
{
// Get shipto attributes.
shipToPath = new XmlElementPath();
QualifiedName shipOrderName = new QualifiedName("shiporder", "http://www.w3schools.com");
shipToPath.Elements.Add(shipOrderName);
shipToPath.Elements.Add(new QualifiedName("shipto", "http://www.w3schools.com"));
shipToAttributes = SchemaCompletionData.GetAttributeCompletionData(shipToPath);
// Get shiporder attributes.
shipOrderPath = new XmlElementPath();
shipOrderPath.Elements.Add(shipOrderName);
shipOrderAttributes = SchemaCompletionData.GetAttributeCompletionData(shipOrderPath);
}
开发者ID:BackupTheBerlios,项目名称:nantgui,代码行数:16,代码来源:ReferencedElementsTestFixture.cs
示例15: FindSchemaObjectType
XmlSchemaObject FindSchemaObjectType(QualifiedName qualifiedName, string elementName, XmlSchemaCompletion schema)
{
switch (elementName) {
case "element":
return schema.FindComplexType(qualifiedName);
case "attribute":
return schema.FindSimpleType(qualifiedName.Name);
}
return null;
}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:10,代码来源:XmlSchemaDefinition.cs
示例16: GetSchemaForQualifiedName
XmlSchemaCompletion GetSchemaForQualifiedName(QualifiedName name)
{
XmlSchemaCompletion schema = schemas[name.Namespace];
if (schema != null) {
return schema;
}
return currentSchema;
}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:8,代码来源:XmlSchemaDefinition.cs
示例17: FindSchemaObjectReference
XmlSchemaObject FindSchemaObjectReference(QualifiedName qualifiedName, string elementName, XmlSchemaCompletion schema)
{
switch (elementName) {
case "element":
return schema.FindRootElement(qualifiedName);
case "attribute":
return schema.FindAttribute(qualifiedName.Name);
case "group":
return schema.FindGroup(qualifiedName.Name);
case "attributeGroup":
return schema.FindAttributeGroup(qualifiedName.Name);
}
return null;
}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:14,代码来源:XmlSchemaDefinition.cs
示例18: GetFullParentElementPath
/// <summary>
/// Gets the parent element path based on the index position. This
/// method does not compact the path so it will include all elements
/// including those in another namespace in the path.
/// </summary>
static XmlElementPath GetFullParentElementPath(string xml)
{
XmlElementPath path = new XmlElementPath();
IDictionary<string, string> namespacesInScope = null;
using (StringReader reader = new StringReader(xml)) {
using (XmlTextReader xmlReader = new XmlTextReader(reader)) {
try {
xmlReader.XmlResolver = null; // prevent XmlTextReader from loading external DTDs
while (xmlReader.Read()) {
switch (xmlReader.NodeType) {
case XmlNodeType.Element:
if (!xmlReader.IsEmptyElement) {
QualifiedName elementName = new QualifiedName(xmlReader.LocalName, xmlReader.NamespaceURI, xmlReader.Prefix);
path.AddElement(elementName);
}
break;
case XmlNodeType.EndElement:
path.Elements.RemoveLast();
break;
}
}
} catch (XmlException) {
namespacesInScope = xmlReader.GetNamespacesInScope(XmlNamespaceScope.All);
}
}
}
// Add namespaces in scope for the last element read.
if (namespacesInScope != null) {
foreach (KeyValuePair<string, string> ns in namespacesInScope) {
path.NamespacesInScope.Add(new XmlNamespace(ns.Key, ns.Value));
}
}
return path;
}
开发者ID:Paccc,项目名称:SharpDevelop,代码行数:41,代码来源:XmlParser.cs
示例19: DesignSurfaceNameAttribute
public void DesignSurfaceNameAttribute()
{
QualifiedName expectedName = new QualifiedName("Name", "clr-namespace:ICSharpCode.WpfDesign.Designer;assembly=ICSharpCode.WpfDesign.Designer", String.Empty);
Assert.AreEqual(expectedName, designSurfaceNameAttribute);
}
开发者ID:BackupTheBerlios,项目名称:nantgui,代码行数:6,代码来源:XamlMixedNamespaceTestFixture.cs
示例20: FindRootElement
/// <summary>
/// Finds an element in the schema.
/// </summary>
/// <remarks>
/// Only looks at the elements that are defined in the
/// root of the schema so it will not find any elements
/// that are defined inside any complex types.
/// </remarks>
public XmlSchemaElement FindRootElement(QualifiedName name)
{
foreach (XmlSchemaElement element in schema.Elements.Values) {
if (name.Equals(element.QualifiedName)) {
return element;
}
}
return null;
}
开发者ID:Netring,项目名称:SharpDevelop,代码行数:17,代码来源:XmlSchemaCompletion.cs
注:本文中的ICSharpCode.XmlEditor.QualifiedName类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论