2 instantiations of XNamespace
System.Private.Xml.Linq (2)
237 references to XNamespace
Aspire.Cli.Tests (6)
dotnet-svcutil-lib (4)
Microsoft.AspNetCore.DataProtection (2)
Microsoft.Build.Tasks.Core (4)
Microsoft.CodeAnalysis.Workspaces (2)
Microsoft.DotNet.Build.Tasks.Installers (1)
Microsoft.DotNet.Build.Tasks.Packaging (1)
Microsoft.DotNet.Build.Tasks.Workloads (3)
Microsoft.DotNet.PackageTesting (1)
Microsoft.DotNet.SharedFramework.Sdk (1)
Microsoft.DotNet.XliffTasks (5)
Microsoft.Extensions.AI.Abstractions.Tests (18)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\TestTypesContext.XNamespace.g.cs (14)
15private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.Xml.Linq.XNamespace>? _XNamespace;
21public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.Xml.Linq.XNamespace> XNamespace
24get => _XNamespace ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.Xml.Linq.XNamespace>)Options.GetTypeInfo(typeof(global::System.Xml.Linq.XNamespace));
27private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.Xml.Linq.XNamespace> Create_XNamespace(global::System.Text.Json.JsonSerializerOptions options)
29if (!TryGetTypeInfoForRuntimeCustomConverter<global::System.Xml.Linq.XNamespace>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.Xml.Linq.XNamespace> jsonTypeInfo))
31var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::System.Xml.Linq.XNamespace>
41jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::System.Xml.Linq.XNamespace>(options, objectInfo);
58DeclaringType = typeof(global::System.Xml.Linq.XNamespace),
60Getter = static obj => ((global::System.Xml.Linq.XNamespace)obj).NamespaceName,
68AttributeProviderFactory = static () => typeof(global::System.Xml.Linq.XNamespace).GetProperty("NamespaceName", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null),
78private void XNamespaceSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::System.Xml.Linq.XNamespace? value)
88writer.WriteString(PropName_NamespaceName, ((global::System.Xml.Linq.XNamespace)value).NamespaceName);
Microsoft.Maui.Resizetizer (5)
Microsoft.NET.Build.Tasks (1)
Microsoft.NET.HostModel (3)
Microsoft.NET.Sdk.Publish.Tasks (1)
Microsoft.TestPlatform.TestHostRuntimeProvider (2)
netstandard (1)
NuGet.Commands (2)
NuGet.Packaging (29)
PackageCreation\Xml\PackageMetadataXmlExtensions.cs (17)
27public static XElement ToXElement(this ManifestMetadata metadata, XNamespace ns)
32public static XElement ToXElement(this ManifestMetadata metadata, XNamespace ns, bool generateBackwardsCompatible = true)
140XNamespace ns,
145Func<XNamespace, TItem, XElement> getXElementFromItem,
200private static XElement GetXElementFromFrameworkReference(XNamespace ns, FrameworkReference frameworkReference)
205private static XElement GetXElementFromPackageReference(XNamespace ns, string reference)
210private static XElement GetXElementFromPackageDependency(XNamespace ns, PackageDependency dependency)
234private static XElement? GetXElementFromFrameworkAssemblies(XNamespace ns, IEnumerable<FrameworkAssemblyReference> references)
251private static XElement? GetXElementFromManifestContentFiles(XNamespace ns, IEnumerable<ManifestContentFiles> contentFiles)
262private static XElement GetXElementFromManifestContentFile(XNamespace ns, ManifestContentFiles file)
276private static XElement GetXElementFromLicenseMetadata(XNamespace ns, LicenseMetadata metadata)
289private static XElement? GetXElementFromManifestRepository(XNamespace ns, RepositoryMetadata repository)
319private static XElement GetXElementFromManifestPackageTypes(XNamespace ns, IEnumerable<PackageType> packageTypes)
332private static XElement GetXElementFromManifestPackageType(XNamespace ns, PackageType packageType)
355private static void AddElementIfNotNull<T>(XElement parent, XNamespace ns, string name, T? value)
364private static void AddElementIfNotNull<T>(XElement parent, XNamespace ns, string name, T? value, Func<T, object> process)
377private static void AddElementIfNotEmpty<T>(XElement parent, XNamespace ns, string name, IEnumerable<T> value, Func<IEnumerable<T>, object> process)
sdk-tasks (1)
Shared.Tests (18)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\TestTypesContext.XNamespace.g.cs (14)
15private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.Xml.Linq.XNamespace>? _XNamespace;
21public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.Xml.Linq.XNamespace> XNamespace
24get => _XNamespace ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.Xml.Linq.XNamespace>)Options.GetTypeInfo(typeof(global::System.Xml.Linq.XNamespace));
27private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.Xml.Linq.XNamespace> Create_XNamespace(global::System.Text.Json.JsonSerializerOptions options)
29if (!TryGetTypeInfoForRuntimeCustomConverter<global::System.Xml.Linq.XNamespace>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.Xml.Linq.XNamespace> jsonTypeInfo))
31var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::System.Xml.Linq.XNamespace>
41jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::System.Xml.Linq.XNamespace>(options, objectInfo);
58DeclaringType = typeof(global::System.Xml.Linq.XNamespace),
60Getter = static obj => ((global::System.Xml.Linq.XNamespace)obj).NamespaceName,
68AttributeProviderFactory = static () => typeof(global::System.Xml.Linq.XNamespace).GetProperty("NamespaceName", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null),
79private void XNamespaceSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::System.Xml.Linq.XNamespace? value)
89writer.WriteString(PropName_NamespaceName, ((global::System.Xml.Linq.XNamespace)value).NamespaceName);
System.Private.CoreLib.Generators (1)
System.Private.Xml.Linq (123)
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\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 (1)
System.Xml.XDocument (1)