UrlReferenceHelper Class
Namespace: Stride.Core.SerializationAssembly: Stride.Core.Serialization.dll
A Helper class for UrlReference and UrlReference<T>.
public static class UrlReferenceHelper
Name | Description | |
---|---|---|
Methods | ||
CreateReference(Type, AssetId, String) | Creates a url reference to the given asset that matches the given reference type. |
|
GetTargetContentType(Type) | Gets the asset content type for a given url reference type. |
|
IsGenericUrlReferenceType(Type) | Checks if the given type is a UrlReference<T> |
|
IsUrlReferenceType(Type) | Checks if the given type is either an UrlReference or a UrlReference<T> |
Methods
CreateReference(Type, AssetId, String)
Creates a url reference to the given asset that matches the given reference type.
public static object CreateReference(Type referenceType, AssetId assetId, string assetUrl)
Parameters
Type | Name | Description |
---|---|---|
System.Type | referenceType | The type of reference to create. |
AssetId | assetId | The target asset id to create. |
System.String | assetUrl | The target asset url to create. |
Returns
Type | Description |
---|---|
System.Object | A url reference to the given asset if it's not null and |
Remarks
A reference type is either an UrlReference or a UrlReference<T>.
GetTargetContentType(Type)
Gets the asset content type for a given url reference type.
public static Type GetTargetContentType(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type is an url reference type, either an UrlReference or a UrlReference<T> |
Returns
Type | Description |
---|---|
System.Type | The target content type or null. |
IsGenericUrlReferenceType(Type)
Checks if the given type is a UrlReference<T>
public static bool IsGenericUrlReferenceType(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to test. |
Returns
Type | Description |
---|---|
System.Boolean |
IsUrlReferenceType(Type)
Checks if the given type is either an UrlReference or a UrlReference<T>
public static bool IsUrlReferenceType(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to test. |
Returns
Type | Description |
---|---|
System.Boolean |