Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    UrlReferenceHelper Class

    Namespace: Stride.Core.Serialization
    Assembly: Stride.Core.Serialization.dll

    A Helper class for UrlReference and UrlReference<T>.

    System.Object → UrlReferenceHelper
    Derived from UrlReferenceHelper:

    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>

    | Improve this Doc View Source

    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 referenceType is a valid reference url type, null otherwise.

    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

    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation