Class UdiParser
Inheritance
Namespace: Umbraco.Cms.Core
Assembly: Umbraco.Core.dll
Syntax
public sealed class UdiParser
Methods
View SourceGetKnownUdiTypes()
Declaration
public static Dictionary<string, UdiType> GetKnownUdiTypes()
Returns
Type | Description |
---|---|
Umbraco.Cms.Core.Dictionary<System.String, UdiType> |
Parse(String)
Converts the string representation of an entity identifier into the equivalent Udi instance.
Declaration
public static Udi Parse(string s)
Parameters
Type | Name | Description |
---|---|---|
System.String | s | The string to convert. |
Returns
Type | Description |
---|---|
Udi | An Udi instance that contains the value that was parsed. |
Parse(String, Boolean)
Converts the string representation of an entity identifier into the equivalent Udi instance.
Declaration
public static Udi Parse(string s, bool knownTypes)
Parameters
Type | Name | Description |
---|---|---|
System.String | s | The string to convert. |
System.Boolean | knownTypes | A value indicating whether to only deal with known types. |
Returns
Type | Description |
---|---|
Udi | An Udi instance that contains the value that was parsed. |
Remarks
If knownTypes
is true
, and the string could not be parsed because
the entity type was not known, the method succeeds but sets udi
to an
UnknownTypeUdi value.
If knownTypes
is true
, assemblies are not scanned for types,
and therefore only builtin types may be known. Unless scanning already took place.
RegisterUdiType(String, UdiType)
Registers a custom entity type.
Declaration
public static void RegisterUdiType(string entityType, UdiType udiType)
Parameters
Type | Name | Description |
---|---|---|
System.String | entityType | |
UdiType | udiType |
ResetUdiTypes()
Internal API for tests to resets all udi types back to only the known udi types.
Declaration
public static void ResetUdiTypes()
TryParse(String, Boolean, out Udi)
Converts the string representation of an entity identifier into the equivalent Udi instance.
Declaration
public static bool TryParse(string s, bool knownTypes, out Udi udi)
Parameters
Type | Name | Description |
---|---|---|
System.String | s | The string to convert. |
System.Boolean | knownTypes | A value indicating whether to only deal with known types. |
Udi | udi | An Udi instance that contains the value that was parsed. |
Returns
Type | Description |
---|---|
System.Boolean | A boolean value indicating whether the string could be parsed. |
Remarks
If knownTypes
is true
, and the string could not be parsed because
the entity type was not known, the method returns false
but still sets udi
to an UnknownTypeUdi value.
If knownTypes
is true
, assemblies are not scanned for types,
and therefore only builtin types may be known. Unless scanning already took place.
TryParse(String, out Udi)
Converts the string representation of an entity identifier into the equivalent Udi instance.
Declaration
public static bool TryParse(string s, out Udi udi)
Parameters
Type | Name | Description |
---|---|---|
System.String | s | The string to convert. |
Udi | udi | An Udi instance that contains the value that was parsed. |
Returns
Type | Description |
---|---|
System.Boolean | A boolean value indicating whether the string could be parsed. |
TryParse<T>(String, out T)
Converts the string representation of an entity identifier into the equivalent Udi instance.
Declaration
public static bool TryParse<T>(string s, out T udi)
where T : Udi
Parameters
Type | Name | Description |
---|---|---|
System.String | s | The string to convert. |
T | udi | An Udi instance that contains the value that was parsed. |
Returns
Type | Description |
---|---|
System.Boolean | A boolean value indicating whether the string could be parsed. |
Type Parameters
Name | Description |
---|---|
T |