XNamespace.Implicit(String to XNamespace) Operator

Definition

Viktigt!

Detta API uppfyller inte CLS.

Konverterar en sträng som innehåller en URI (Uniform Resource Identifier) till en XNamespace.

public:
 static operator System::Xml::Linq::XNamespace ^(System::String ^ namespaceName);
[System.CLSCompliant(false)]
public static implicit operator System.Xml.Linq.XNamespace(string namespaceName);
[System.CLSCompliant(false)]
public static implicit operator System.Xml.Linq.XNamespace?(string? namespaceName);
[<System.CLSCompliant(false)>]
static member op_Implicit : string -> System.Xml.Linq.XNamespace
Public Shared Widening Operator CType (namespaceName As String) As XNamespace

Parametrar

namespaceName
String

En String som innehåller namnområdets URI.

Returer

En XNamespace konstruerad från URI-strängen.

Attribut

Exempel

I följande exempel visas initieringen av en XNamespace variabel genom att tilldela en sträng till den.

XNamespace aw = "http://www.adventure-works.com";
Console.WriteLine(aw);
Imports <xmlns="http://www.adventure-works.com">

Module Module1
    Sub Main()
        Dim aw As XNamespace = GetXmlNamespace()
        Console.WriteLine(aw)
    End Sub
End Module

Det här exemplet genererar följande utdata:

http://www.adventure-works.com

Gäller för

Se även