2 instantiations of XNamespace
System.Private.Xml.Linq (2)
System\Xml\Linq\XNamespace.cs (2)
258refNamespace = s_namespaces.Add(new WeakReference<XNamespace>(new XNamespace(namespaceName.Substring(index, count)))); 310Interlocked.CompareExchange(ref refNmsp, new WeakReference<XNamespace>(new XNamespace(namespaceName)), refOld);
169 references to XNamespace
BuildBoss (4)
ProjectUtil.cs (2)
24internal XNamespace Namespace { get; } 42Manager.AddNamespace("mb", Namespace == XNamespace.None ? "" : SharedUtil.MSBuildNamespaceUriRaw);
SharedUtil.cs (2)
21internal static XNamespace MSBuildNamespace { get; } = XNamespace.Get(MSBuildNamespaceUriRaw);
dotnet-svcutil-lib (4)
Shared\MSBuildProj.cs (4)
24private XNamespace _msbuildNS; 173var msbuildNS = XNamespace.None; 459private static IEnumerable<XElement> GetSubGroupValues(XElement projectElement, XNamespace msbuildNS, string group, string subGroupName)
IIS.FunctionalTests (2)
src\Servers\IIS\IIS\test\Common.FunctionalTests\FrebTests.cs (2)
153var nameSpace = (XNamespace)"http://schemas.microsoft.com/win/2004/08/events/event";
IISExpress.FunctionalTests (2)
src\Servers\IIS\IIS\test\Common.FunctionalTests\FrebTests.cs (2)
153var nameSpace = (XNamespace)"http://schemas.microsoft.com/win/2004/08/events/event";
Microsoft.AspNetCore.DataProtection (2)
XmlConstants.cs (2)
16private static readonly XNamespace RootNamespace = XNamespace.Get("http://schemas.asp.net/2015/03/dataProtection");
Microsoft.AspNetCore.DataProtection.Tests (1)
XmlAssert.cs (1)
109&& attribute.Name.Namespace != XNamespace.Xmlns;
Microsoft.Build.BuildCheck.UnitTests (1)
TestAssemblyInfo.cs (1)
120var ns = doc.Root.Name.Namespace;
Microsoft.Build.CommandLine.UnitTests (1)
TestAssemblyInfo.cs (1)
120var ns = doc.Root.Name.Namespace;
Microsoft.Build.Engine.OM.UnitTests (1)
TestAssemblyInfo.cs (1)
120var ns = doc.Root.Name.Namespace;
Microsoft.Build.Engine.UnitTests (1)
TestAssemblyInfo.cs (1)
120var ns = doc.Root.Name.Namespace;
Microsoft.Build.Framework.UnitTests (1)
TestAssemblyInfo.cs (1)
120var ns = doc.Root.Name.Namespace;
Microsoft.Build.Tasks.Core (4)
AssemblyDependency\GenerateBindingRedirects.cs (2)
88var ns = XNamespace.Get("urn:schemas-microsoft-com:asm.v1");
AssemblyDependency\ResolveAssemblyReference.cs (2)
1165var ns = XNamespace.Get("urn:schemas-microsoft-com:asm.v1");
Microsoft.Build.Tasks.UnitTests (1)
TestAssemblyInfo.cs (1)
120var ns = doc.Root.Name.Namespace;
Microsoft.Build.Utilities.UnitTests (1)
TestAssemblyInfo.cs (1)
120var ns = doc.Root.Name.Namespace;
Microsoft.DotNet.Build.Tasks.Installers (1)
src\StabilizeWixFileId.cs (1)
54XNamespace rootNamespace = content.Root.GetDefaultNamespace();
Microsoft.DotNet.Build.Tasks.Packaging (1)
GenerateNuSpec.cs (1)
24private static readonly XNamespace NuSpecXmlNamespace = @"http://schemas.microsoft.com/packaging/2013/01/nuspec.xsd";
Microsoft.DotNet.Build.Tasks.Workloads (2)
Msi\WorkloadPackGroupMsi.wix.cs (2)
93var ns = productDoc.Root.Name.Namespace; 183XNamespace ns = "http://schemas.microsoft.com/wix/2006/wi";
Microsoft.DotNet.PackageTesting (1)
VerifyClosure.cs (1)
342private static XNamespace s_dgmlns = @"http://schemas.microsoft.com/vs/2009/dgml";
Microsoft.DotNet.SharedFramework.Sdk (1)
src\Microsoft.DotNet.PackageTesting\VerifyClosure.cs (1)
342private static XNamespace s_dgmlns = @"http://schemas.microsoft.com/vs/2009/dgml";
Microsoft.DotNet.XliffTasks (5)
Model\XlfDocument.cs (4)
26private static readonly XNamespace XsiNS = "http://www.w3.org/2001/XMLSchema-instance"; 51new XAttribute(XNamespace.Xmlns + "xsi", XsiNS.NamespaceName), 224XNamespace ns = _document.Root.Name.Namespace; 277XNamespace ns = _document.Root.Name.Namespace;
Model\XlfNames.cs (1)
10public static readonly XNamespace XliffNS = "urn:oasis:names:tc:xliff:document:1.2";
Microsoft.Maui.Resizetizer (5)
GeneratePackageAppxManifest.cs (2)
20 static readonly XNamespace xmlnsUap = "http://schemas.microsoft.com/appx/manifest/uap/windows10"; 74 var xmlns = appx.Root!.GetDefaultNamespace();
GenerateTizenManifest.cs (3)
83 var xmlns = tizenManifest.Root!.GetDefaultNamespace(); 97 void UpdateSharedManifest(XNamespace xmlns, XElement manifest) 132 void UpdateSharedResources(XNamespace xmlns, XElement manifestElement)
Microsoft.VisualStudio.LanguageServices (1)
Snippets\SnippetExpansionClient.cs (1)
635XNamespace snippetNamespace = "http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet";
netstandard (1)
netstandard.cs (1)
2275[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Xml.Linq.XNamespace))]
System.Private.Xml.Linq (123)
System\Xml\Linq\XAttribute.cs (9)
93return (object)namespaceName == (object)XNamespace.xmlnsPrefixNamespace; 690internal string? GetPrefixOfNamespace(XNamespace ns) 695if ((object)namespaceName == (object)XNamespace.xmlPrefixNamespace) return "xml"; 696if ((object)namespaceName == (object)XNamespace.xmlnsPrefixNamespace) return "xmlns"; 704if ((object)namespaceName == (object)XNamespace.xmlnsPrefixNamespace) 712else if (value == XNamespace.xmlPrefixNamespace) 718else if (value == XNamespace.xmlnsPrefixNamespace) 742if (value == XNamespace.xmlPrefixNamespace) 748else if (value == XNamespace.xmlnsPrefixNamespace)
System\Xml\Linq\XElement.cs (15)
466/// Returns the default <see cref="XNamespace"/> of an <see cref="XElement"/> 468public XNamespace GetDefaultNamespace() 471return namespaceName != null ? XNamespace.Get(namespaceName) : XNamespace.None; 479/// <returns>An <see cref="XNamespace"/> for the namespace bound to the prefix</returns> 480public XNamespace? GetNamespaceOfPrefix(string prefix) 483if (prefix == "xmlns") return XNamespace.Xmlns; 485if (namespaceName != null) return XNamespace.Get(namespaceName); 486if (prefix == "xml") return XNamespace.Xml; 493/// <param name="ns">The <see cref="XNamespace"/> for which to get a prefix</param> 495public string? GetPrefixOfNamespace(XNamespace ns) 531if ((object)namespaceName == (object)XNamespace.xmlPrefixNamespace) 535else if ((object)namespaceName == (object)XNamespace.xmlnsPrefixNamespace) 2049name = XNamespace.Get(r.NamespaceURI).GetName(r.LocalName); 2071XAttribute a = new XAttribute(XNamespace.Get(r.Prefix.Length == 0 ? string.Empty : r.NamespaceURI).GetName(r.LocalName), r.Value);
System\Xml\Linq\XLinq.cs (22)
183private XNamespace _ns; 186public XNamespace Get(string namespaceName) 190_ns = XNamespace.Get(namespaceName); 295private string? GetPrefixOfNamespace(XNamespace ns, bool allowDefaultNamespace) 301if ((object)namespaceName == (object)XNamespace.xmlPrefixNamespace) return "xml"; 302if ((object)namespaceName == (object)XNamespace.xmlnsPrefixNamespace) return "xmlns"; 320_resolver.AddFirst(a.Name.NamespaceName.Length == 0 ? string.Empty : a.Name.LocalName, XNamespace.Get(a.Value)); 338_resolver.Add(a.Name.NamespaceName.Length == 0 ? string.Empty : a.Name.LocalName, XNamespace.Get(a.Value)); 373XNamespace ns = e.Name.Namespace; 384_writer.WriteAttributeString(GetPrefixOfNamespace(ns, false), localName, namespaceName.Length == 0 && localName == "xmlns" ? XNamespace.xmlnsPrefixNamespace : namespaceName, a.Value); 392XNamespace ns = e.Name.Namespace; 404await _writer.WriteAttributeStringAsync(GetPrefixOfNamespace(ns, false), localName, namespaceName.Length == 0 && localName == "xmlns" ? XNamespace.xmlnsPrefixNamespace : namespaceName, a.Value).ConfigureAwait(false); 415public XNamespace ns = null!; 452public void Add(string prefix, XNamespace ns) 470public void AddFirst(string prefix, XNamespace ns) 491public string? GetPrefixOfNamespace(XNamespace ns, bool allowDefaultNamespace) 546XNamespace ns = _element.Name.Namespace; 553_writer.WriteAttributeString(GetPrefixOfNamespace(ns, false), localName, namespaceName.Length == 0 && localName == "xmlns" ? XNamespace.xmlnsPrefixNamespace : namespaceName, a.Value); 560private string? GetPrefixOfNamespace(XNamespace ns, bool allowDefaultNamespace) 566if ((object)namespaceName == (object)XNamespace.xmlPrefixNamespace) return "xml"; 567if ((object)namespaceName == (object)XNamespace.xmlnsPrefixNamespace) return "xmlns"; 578_resolver.Add(a.Name.NamespaceName.Length == 0 ? string.Empty : a.Name.LocalName, XNamespace.Get(a.Value));
System\Xml\Linq\XName.cs (6)
15private readonly XNamespace _ns; 22internal XName(XNamespace ns, string localName) 41public XNamespace Namespace 79return XNamespace.Get(expandedName, 1, i - 1).GetName(expandedName, i + 1, expandedName.Length - i - 1); 83return XNamespace.None.GetName(expandedName); 95return XNamespace.Get(namespaceName).GetName(localName);
System\Xml\Linq\XNamespace.cs (54)
19private static XHashtable<WeakReference<XNamespace>>? s_namespaces; 20private static WeakReference<XNamespace>? s_refNone; 21private static WeakReference<XNamespace>? s_refXml; 22private static WeakReference<XNamespace>? s_refXmlns; 64/// Returns the namespace name of this <see cref="XNamespace"/>. 73/// Gets the <see cref="XNamespace"/> object that corresponds to no namespace. 79public static XNamespace None 88/// Gets the <see cref="XNamespace"/> object that corresponds to the xml uri (http://www.w3.org/XML/1998/namespace). 90public static XNamespace Xml 99/// Gets the <see cref="XNamespace"/> object that corresponds to the xmlns uri (http://www.w3.org/2000/xmlns/). 101public static XNamespace Xmlns 110/// Gets an <see cref="XNamespace"/> created from the specified namespace name. 113/// The returned <see cref="XNamespace"/> object is guaranteed to be atomic 116public static XNamespace Get(string namespaceName) 124/// Converts a string containing a namespace name to an <see cref="XNamespace"/>. 127/// <returns>An <see cref="XNamespace"/> constructed from the namespace name string.</returns> 130public static implicit operator XNamespace?(string? namespaceName) 136/// Combines an <see cref="XNamespace"/> object with a local name to create an <see cref="XName"/>. 141public static XName operator +(XNamespace ns, string localName) 149/// Determines whether the specified <see cref="XNamespace"/> is equal to the current <see cref="XNamespace"/>. 151/// <param name="obj">The <see cref="XNamespace"/> to compare to the current <see cref="XNamespace"/>.</param> 153/// true if the specified <see cref="XNamespace"/> is equal to the current <see cref="XNamespace"/>; otherwise false. 156/// For two <see cref="XNamespace"/> objects to be equal they must have the same 165/// Serves as a hash function for <see cref="XNamespace"/>. GetHashCode is suitable 181/// Returns a value indicating whether two instances of <see cref="XNamespace"/> are equal. 183/// <param name="left">The first <see cref="XNamespace"/> to compare.</param> 184/// <param name="right">The second <see cref="XNamespace"/> to compare.</param> 188/// an instance of <see cref="XNamespace"/> and string. 190public static bool operator ==(XNamespace? left, XNamespace? right) 196/// Returns a value indicating whether two instances of <see cref="XNamespace"/> are not equal. 198/// <param name="left">The first <see cref="XNamespace"/> to compare.</param> 199/// <param name="right">The second <see cref="XNamespace"/> to compare.</param> 203/// an instance of <see cref="XNamespace"/> and string. 205public static bool operator !=(XNamespace? left, XNamespace? right) 230/// Returns an <see cref="XNamespace"/> created from a portion of the passed in namespace name parameter. The returned <see cref="XNamespace"/> 233internal static XNamespace Get(string namespaceName, int index, int count) 242Interlocked.CompareExchange(ref s_namespaces, new XHashtable<WeakReference<XNamespace>>(ExtractNamespace, NamespacesCapacity), null); 244WeakReference<XNamespace>? refNamespace; 245XNamespace? ns; 258refNamespace = s_namespaces.Add(new WeakReference<XNamespace>(new XNamespace(namespaceName.Substring(index, count)))); 261ns = refNamespace != null && refNamespace.TryGetTarget(out XNamespace? target) ? target : null; 282private static string? ExtractNamespace(WeakReference<XNamespace>? r) => 284r.TryGetTarget(out XNamespace? target) ? target.NamespaceName : null; 292private static XNamespace EnsureNamespace(ref WeakReference<XNamespace>? refNmsp, string namespaceName) 294WeakReference<XNamespace>? refOld; 302if (refOld != null && refOld.TryGetTarget(out XNamespace? ns)) 310Interlocked.CompareExchange(ref refNmsp, new WeakReference<XNamespace>(new XNamespace(namespaceName)), refOld);
System\Xml\Linq\XNodeBuilder.cs (2)
169_attrName = XNamespace.Get(prefix.Length == 0 ? string.Empty : namespaceName!).GetName(localName); 183AddNode(new XElement(XNamespace.Get(namespaceName!).GetName(localName)));
System\Xml\Linq\XNodeReader.cs (9)
262return XNamespace.xmlnsPrefixNamespace; 399XName name = XNamespace.Xml.GetName("lang"); 425XName name = XNamespace.Xml.GetName("space"); 525if (namespaceName == XNamespace.xmlnsPrefixNamespace) 597XNamespace? ns = prefix.Length == 0 ? e.GetDefaultNamespace() : e.GetNamespaceOfPrefix(prefix); 659if (namespaceName == XNamespace.xmlnsPrefixNamespace) 1075nameTable.Add(XNamespace.xmlnsPrefixNamespace); 1076nameTable.Add(XNamespace.xmlPrefixNamespace); 1147XNamespace? ns = e.GetNamespaceOfPrefix(qualifiedName.Substring(0, i));
System\Xml\Schema\XNodeValidator.cs (3)
35XNamespace xsi = XNamespace.Get("http://www.w3.org/2001/XMLSchema-instance"); 288a = new XAttribute(XNamespace.Get(sa.QualifiedName.Namespace).GetName(sa.QualifiedName.Name), GetDefaultValue(sa)!);
System\Xml\XPath\XNodeNavigator.cs (3)
13internal static readonly string xmlPrefixNamespace = XNamespace.Xml.NamespaceName; 14internal static readonly string xmlnsPrefixNamespace = XNamespace.Xmlns.NamespaceName; 843System.Threading.Interlocked.CompareExchange(ref s_XmlNamespaceDeclaration, new XAttribute(XNamespace.Xmlns.GetName("xml"), xmlPrefixNamespace), null);
System.Xml.Linq (1)
System.Xml.Linq.cs (1)
17[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Xml.Linq.XNamespace))]
System.Xml.XDocument (1)
artifacts\obj\System.Xml.XDocument\Debug\net10.0\System.Xml.XDocument.Forwards.cs (1)
16[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Xml.Linq.XNamespace))]