Table of Contents

Class AttachedReferenceManager

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

Manage object reference information externally, not stored in the object but in a separate AttachedReference object.

public static class AttachedReferenceManager
Inheritance
AttachedReferenceManager

Methods

CreateProxyObject(Type, AssetId, string)

Creates a proxy object with AttachedReference designing it as a proxy with a given id and location (that can be used with ContentManager). This allows to construct and save object references without actually loading them.

public static object CreateProxyObject(Type type, AssetId id, string location)

Parameters

type Type

The type.

id AssetId

The identifier.

location string

The location.

Returns

object

CreateProxyObject<T>(AssetId, string)

Creates a proxy object with AttachedReference designing it as a proxy with a given id and location (that can be used with ContentManager). This allows to construct and save object references without actually loading them.

public static T CreateProxyObject<T>(AssetId id, string location) where T : class, new()

Parameters

id AssetId

The identifier.

location string

The location.

Returns

T

Type Parameters

T

CreateProxyObject<T>(IReference)

Creates a proxy object with AttachedReference designing it as a proxy with a given id and location (that can be used with ContentManager). This allows to construct and save object references without actually loading them.

public static T CreateProxyObject<T>(IReference reference) where T : class, new()

Parameters

reference IReference

The content reference.

Returns

T

T.

Type Parameters

T

Exceptions

ArgumentNullException

reference

GetAttachedReference(object)

Gets the reference info of attached to a given object, if it exists.

public static AttachedReference GetAttachedReference(object obj)

Parameters

obj object

The object for which to get the attached reference. Can be null, in this case this method returns null.

Returns

AttachedReference

The AttachedReference attached to the given object if available, null otherwise.

GetOrCreateAttachedReference(object)

Gets or creates the object reference info of a given object.

public static AttachedReference GetOrCreateAttachedReference(object obj)

Parameters

obj object

The object.

Returns

AttachedReference

GetUrl(object)

Gets the URL of a given object.

public static string GetUrl(object obj)

Parameters

obj object

The object.

Returns

string

The URL.

SetUrl(object, string)

Sets the URL of a given object.

public static void SetUrl(object obj, string url)

Parameters

obj object

The object.

url string

The URL.