• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# XmlEditor.QualifiedName类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# XmlEditor.XmlElementPath类代码示例发布时间:2022-05-26
下一篇:
C# XamlBinding.XamlCompletionContext类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap