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

C# XmlNamespaceScope类代码示例

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

本文整理汇总了C#中XmlNamespaceScope的典型用法代码示例。如果您正苦于以下问题:C# XmlNamespaceScope类的具体用法?C# XmlNamespaceScope怎么用?C# XmlNamespaceScope使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



XmlNamespaceScope类属于命名空间,在下文中一共展示了XmlNamespaceScope类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GetNamespacesInScope

 internal IDictionary<string, string> GetNamespacesInScope(XmlNamespaceScope scope)
 {
     if (this.reader is IXmlNamespaceResolver)
     {
         return ((IXmlNamespaceResolver) this.reader).GetNamespacesInScope(scope);
     }
     return null;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:XmlReaderDelegator.cs


示例2: GetNamespacesInScope

        public IDictionary<string, string> GetNamespacesInScope(XmlNamespaceScope scope) {
            switch(scope) {
                case XmlNamespaceScope.All:
                    return GetNamespaceDecls(null, false);

                case XmlNamespaceScope.Local:
                    return GetNamespaceDecls(element.Parent, false);

                case XmlNamespaceScope.ExcludeXml:
                    return GetNamespaceDecls(null, true);
            }
            return null;
        }
开发者ID:pusp,项目名称:o2platform,代码行数:13,代码来源:Interfaces.cs


示例3:

		IDictionary<string, string> IXmlNamespaceResolver.GetNamespacesInScope (XmlNamespaceScope scope)
		{
			return ((IXmlNamespaceResolver) reader).GetNamespacesInScope (scope);
		}
开发者ID:nobled,项目名称:mono,代码行数:4,代码来源:XmlFilterReader.cs


示例4:

		///<summary>
		///Gets a collection of defined prefix-namespace Mappings that are currently in scope.
		///</summary>
		///
		///<returns>
		///An <see cref="T:System.Collections.IDictionary"></see> that contains the current in-scope namespaces.
		///</returns>
		///
		///<param name="scope">An <see cref="T:System.Xml.XmlNamespaceScope"></see> value that specifies the type of namespace nodes to return.</param>
		IDictionary<string, string> IXmlNamespaceResolver.GetNamespacesInScope(XmlNamespaceScope scope)
		{
			XmlNamespaceCollection namespaces = readingElements.Peek().Namespaces;
			Dictionary<String, String> list = new Dictionary<string, string>();
			foreach (XmlNamespace ns in namespaces)
			{
				list.Add(ns.Prefix, ns.Namespace);
			}

			return list;
		}
开发者ID:95ulisse,项目名称:ILEdit,代码行数:20,代码来源:XmlBamlReader.cs


示例5:

//
// IXmlNamespaceResolver implementation
//
        IDictionary<string,string> IXmlNamespaceResolver.GetNamespacesInScope( XmlNamespaceScope scope ) {
            if ( !InNamespaceActiveState ) {
                return new Dictionary<string,string>();
            }
            return nsManager.GetNamespacesInScope( scope );
        }
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:9,代码来源:xmlsubtreereader.cs


示例6:

 IDictionary<string, string> IXmlNamespaceResolver.GetNamespacesInScope(XmlNamespaceScope scope)
 {
     return _nav.GetNamespacesInScope(scope);
 }
开发者ID:Corillian,项目名称:corefx,代码行数:4,代码来源:XPathNavigatorReader.cs


示例7: GetNamespacesInScope

		public virtual IDictionary<string, string> GetNamespacesInScope (XmlNamespaceScope scope)
		{
			IDictionary<string, string> table = new Dictionary<string, string> ();
			XPathNamespaceScope xpscope =
				scope == XmlNamespaceScope.Local ?
					XPathNamespaceScope.Local :
				scope == XmlNamespaceScope.ExcludeXml ?
					XPathNamespaceScope.ExcludeXml :
				XPathNamespaceScope.All;
			XPathNavigator nav = Clone ();
			if (nav.NodeType != XPathNodeType.Element)
				nav.MoveToParent ();
			if (!nav.MoveToFirstNamespace (xpscope))
				return table;
			do {
				table.Add (nav.Name, nav.Value);
			} while (nav.MoveToNextNamespace (xpscope));
			return table;
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:19,代码来源:XPathNavigator.cs


示例8: GetNamespacesInScope

 // Internal IXmlNamespaceResolver methods
 internal IDictionary<string, string> GetNamespacesInScope(XmlNamespaceScope scope)
 {
     return _namespaceManager.GetNamespacesInScope(scope);
 }
开发者ID:chcosta,项目名称:corefx,代码行数:5,代码来源:XmlTextReaderImpl.cs


示例9:

		IDictionary<string, string> IXmlNamespaceResolver.GetNamespacesInScope (XmlNamespaceScope scope)
		{
			return nsResolver != null ? nsResolver.GetNamespacesInScope (scope) : 
				new Dictionary<string, string> ();
		}
开发者ID:user277,项目名称:mono,代码行数:5,代码来源:SubtreeXmlReader.cs


示例10: GetNamespacesInScope

 public System.Collections.Generic.IDictionary<string, string> GetNamespacesInScope (XmlNamespaceScope scope) {
     throw new NotImplementedException ();
 }
开发者ID:nhhoang,项目名称:shooting,代码行数:3,代码来源:AndroidManifestMerger.cs


示例11: GetNamespacesInScope

        // This pragma disables a warning that the return type is not CLS-compliant, but generics are part of CLS in Whidbey. 
#pragma warning disable 3002
        public virtual IDictionary<string, string> GetNamespacesInScope(XmlNamespaceScope scope)
        {
#pragma warning restore 3002
            int i = 0;
            switch (scope)
            {
                case XmlNamespaceScope.All:
                    i = 2;
                    break;
                case XmlNamespaceScope.ExcludeXml:
                    i = 3;
                    break;
                case XmlNamespaceScope.Local:
                    i = _lastDecl;
                    while (_nsdecls[i].scopeId == _scopeId)
                    {
                        i--;
                        Debug.Assert(i >= 2);
                    }
                    i++;
                    break;
            }

            Dictionary<string, string> dict = new Dictionary<string, string>(_lastDecl - i + 1);
            for (; i <= _lastDecl; i++)
            {
                string prefix = _nsdecls[i].prefix;
                string uri = _nsdecls[i].uri;
                Debug.Assert(prefix != null);

                if (uri != null)
                {
                    if (uri.Length > 0 || prefix.Length > 0 || scope == XmlNamespaceScope.Local)
                    {
                        dict[prefix] = uri;
                    }
                    else
                    {
                        // default namespace redeclared to "" -> remove from list for all scopes other than local
                        dict.Remove(prefix);
                    }
                }
            }
            return dict;
        }
开发者ID:shiftkey-tester,项目名称:corefx,代码行数:47,代码来源:XmlNamespaceManager.cs


示例12: GetNamespacesInScope

		public IDictionary<string, string> GetNamespacesInScope (XmlNamespaceScope scope)
		{
			IXmlNamespaceResolver resolver = reader as IXmlNamespaceResolver;
			if (resolver == null)
				throw new NotSupportedException ("The input XmlReader does not implement IXmlNamespaceResolver and thus this validating reader cannot collect in-scope namespaces.");
			return resolver.GetNamespacesInScope (scope);
		}
开发者ID:nobled,项目名称:mono,代码行数:7,代码来源:XmlSchemaValidatingReader.cs


示例13: GetNamespacesInScope

 internal IDictionary<string, string> GetNamespacesInScope(XmlNamespaceScope scope)
 {
     Dictionary<string, string> dictionary = new Dictionary<string, string>();
     if (!this.bCreatedOnAttribute)
     {
         XmlNode curNode = this.curNode;
         while (curNode != null)
         {
             if (curNode.NodeType == XmlNodeType.Element)
             {
                 XmlElement element = (XmlElement) curNode;
                 if (element.HasAttributes)
                 {
                     XmlAttributeCollection attributes = element.Attributes;
                     for (int i = 0; i < attributes.Count; i++)
                     {
                         XmlAttribute attribute = attributes[i];
                         if ((attribute.LocalName == "xmlns") && (attribute.Prefix.Length == 0))
                         {
                             if (!dictionary.ContainsKey(string.Empty))
                             {
                                 dictionary.Add(this.nameTable.Add(string.Empty), this.nameTable.Add(attribute.Value));
                             }
                         }
                         else if (attribute.Prefix == "xmlns")
                         {
                             string localName = attribute.LocalName;
                             if (!dictionary.ContainsKey(localName))
                             {
                                 dictionary.Add(this.nameTable.Add(localName), this.nameTable.Add(attribute.Value));
                             }
                         }
                     }
                 }
                 if (scope == XmlNamespaceScope.Local)
                 {
                     break;
                 }
             }
             else if (curNode.NodeType == XmlNodeType.Attribute)
             {
                 curNode = ((XmlAttribute) curNode).OwnerElement;
                 continue;
             }
             curNode = curNode.ParentNode;
         }
         if (scope != XmlNamespaceScope.Local)
         {
             if (dictionary.ContainsKey(string.Empty) && (dictionary[string.Empty] == string.Empty))
             {
                 dictionary.Remove(string.Empty);
             }
             if (scope == XmlNamespaceScope.All)
             {
                 dictionary.Add(this.nameTable.Add("xml"), this.nameTable.Add("http://www.w3.org/XML/1998/namespace"));
             }
         }
     }
     return dictionary;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:60,代码来源:XmlNodeReaderNavigator.cs


示例14: Hashtable

		IDictionary IXmlNamespaceResolver.GetNamespacesInScope (XmlNamespaceScope scope)
		{
			return nsResolver != null ? nsResolver.GetNamespacesInScope (scope) : new Hashtable ();
		}
开发者ID:nlhepler,项目名称:mono,代码行数:4,代码来源:SubtreeXmlReader.cs


示例15: GetNamespacesInScope

        public virtual IDictionary<string, string> GetNamespacesInScope(XmlNamespaceScope scope)
        {
            XPathNodeType nt = NodeType;
            if ((nt != XPathNodeType.Element && scope != XmlNamespaceScope.Local) || nt == XPathNodeType.Attribute || nt == XPathNodeType.Namespace)
            {
                XPathNavigator navSave = Clone();

                // If current item is not an element, then try parent
                if (navSave.MoveToParent())
                    return navSave.GetNamespacesInScope(scope);
            }

            Dictionary<string, string> dict = new Dictionary<string, string>();

            // "xml" prefix always in scope
            if (scope == XmlNamespaceScope.All)
                dict["xml"] = XmlConst.ReservedNsXml;

            // Now add all in-scope namespaces
            if (MoveToFirstNamespace((XPathNamespaceScope)scope))
            {
                do
                {
                    string prefix = LocalName;
                    string ns = Value;

                    // Exclude xmlns="" declarations unless scope = Local
                    if (prefix.Length != 0 || ns.Length != 0 || scope == XmlNamespaceScope.Local)
                        dict[prefix] = ns;
                }
                while (MoveToNextNamespace((XPathNamespaceScope)scope));

                MoveToParent();
            }

            return dict;
        }
开发者ID:noahfalk,项目名称:corefx,代码行数:37,代码来源:XPathNavigator.cs


示例16: GetNamespacesInScope

		public virtual IDictionary<string, string> GetNamespacesInScope (XmlNamespaceScope scope)
		{
			IDictionary namespaceTable = GetNamespacesInScopeImpl (scope);
			IDictionary<string, string> namespaces = new Dictionary<string, string>(namespaceTable.Count);

			foreach (DictionaryEntry entry in namespaceTable) {
				namespaces[(string) entry.Key] = (string) entry.Value;
			}
			return namespaces;
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:10,代码来源:XmlFormatterWriter.cs


示例17: GetNamespacesInScope

 public virtual IDictionary<string, string> GetNamespacesInScope(XmlNamespaceScope scope)
 {
     XPathNodeType nodeType = this.NodeType;
     if (((nodeType != XPathNodeType.Element) && (scope != XmlNamespaceScope.Local)) || ((nodeType == XPathNodeType.Attribute) || (nodeType == XPathNodeType.Namespace)))
     {
         XPathNavigator navigator = this.Clone();
         if (navigator.MoveToParent())
         {
             return navigator.GetNamespacesInScope(scope);
         }
     }
     Dictionary<string, string> dictionary = new Dictionary<string, string>();
     if (scope == XmlNamespaceScope.All)
     {
         dictionary["xml"] = "http://www.w3.org/XML/1998/namespace";
     }
     if (this.MoveToFirstNamespace((XPathNamespaceScope) scope))
     {
         do
         {
             string localName = this.LocalName;
             string str2 = this.Value;
             if (((localName.Length != 0) || (str2.Length != 0)) || (scope == XmlNamespaceScope.Local))
             {
                 dictionary[localName] = str2;
             }
         }
         while (this.MoveToNextNamespace((XPathNamespaceScope) scope));
         this.MoveToParent();
     }
     return dictionary;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:32,代码来源:XPathNavigator.cs


示例18: GetNamespacesInScopeImpl

		internal virtual IDictionary GetNamespacesInScopeImpl (XmlNamespaceScope scope)
		{
			Hashtable table = new Hashtable ();

			if (scope == XmlNamespaceScope.Local) {
				for (int i = 0; i < count; i++)
					if (decls [declPos - i].Prefix == String.Empty && decls [declPos - i].Uri == String.Empty) {
						if (table.Contains (String.Empty))
							table.Remove (String.Empty);
					}
					else if (decls [declPos - i].Uri != null)
						table.Add (decls [declPos - i].Prefix, decls [declPos - i].Uri);
				return table;
			} else {
				for (int i = 0; i <= declPos; i++) {
					if (decls [i].Prefix == String.Empty && decls [i].Uri == String.Empty) {
						// removal of default namespace
						if (table.Contains (String.Empty))
							table.Remove (String.Empty);
					}
					else if (decls [i].Uri != null)
						table [decls [i].Prefix] = decls [i].Uri;
				}

				if (scope == XmlNamespaceScope.All)
					table.Add ("xml", XmlNamespaceManager.XmlnsXml);
				return table;
			}
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:29,代码来源:XmlFormatterWriter.cs


示例19: GetNamespacesInScope

 public IDictionary<string, string> GetNamespacesInScope(XmlNamespaceScope scope)
 {
 }
开发者ID:Pengfei-Gao,项目名称:source-Insight-3-for-centos7,代码行数:3,代码来源:XmlTextReader.cs


示例20:

 //
 // IXmlNamespaceResolver members
 //
 IDictionary<string, string> IXmlNamespaceResolver.GetNamespacesInScope(XmlNamespaceScope scope) {
     if (coreReaderNSResolver != null) {
         return coreReaderNSResolver.GetNamespacesInScope(scope);
     }
     else {
         return nsManager.GetNamespacesInScope(scope);
     }
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:11,代码来源:XsdValidatingReader.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# XmlNode类代码示例发布时间:2022-05-24
下一篇:
C# XmlNamespaceManager类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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