AnyUri.TryCreate Method (AnyUri, string, out AnyUri)AnyUri.TryCreate Method (AnyUri, String, ByRef AnyUri)AnyUri::TryCreate Method (AnyUri^, String^, AnyUri^%)

Creates a new AnyUriAnyUriAnyUri from its lexical value and resolves it against a base URI. A return value indicates whether the conversion succeeded or failed.

Syntax

Public Shared Function TryCreate( _
    baseUri As AnyUri, _
    relative As String, _
    <Out>result As ByRef AnyUri _
) As Boolean
public static bool TryCreate(
    AnyUri baseUri,
    string relative,
    out AnyUri result
)
public:
static bool TryCreate(
    AnyUri^ baseUri, 
    String^ relative, 
    [Out] AnyUri^% result
)
 

Parameters

baseUri

Type: XmlPrime.AnyUriXmlPrime.AnyUriXmlPrime::AnyUri^

The base URI.

relative

Type: System.StringSystem.StringSystem::String^

The lexical representation of the relative URI.

result

Type: out XmlPrime.AnyUriByRef XmlPrime.AnyUriXmlPrime::AnyUri^%

When this method returns, contains a AnyUriAnyUriAnyUri constructed from baseUri and relative.

Return Value

Type: System.BooleanSystem.BooleanSystem::Boolean

trueTruetrue if the AnyUriAnyUriAnyUri was successfully created; otherwise falseFalsefalse.

Exceptions

ExceptionCondition
ArgumentNullExceptionArgumentNullExceptionArgumentNullException baseUri or relative is null a null reference (Nothing in Visual Basic) nullptr.

Remarks

If relative is not a valid URI, then the string is percent encoded and another attempt is made to parse it.