AttachedReferenceManager Class
Namespace: Stride.Core.SerializationAssembly: Stride.Core.Serialization.dll
Manage object reference information externally, not stored in the object but in a separate AttachedReference object.
public static class AttachedReferenceManager
Name | Description | |
---|---|---|
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. |
|
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. |
|
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. |
|
GetAttachedReference(Object) | Gets the reference info of attached to a given object, if it exists. |
|
GetOrCreateAttachedReference(Object) | Gets or creates the object reference info of a given object. |
|
GetUrl(Object) | Gets the URL of a given object. |
|
SetUrl(Object, String) | Sets the URL of a given object. |
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 | Name | Description |
---|---|---|
System.Type | type | The type. |
AssetId | id | The identifier. |
System.String | location | The location. |
Returns
Type | Description |
---|---|
System.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
Type | Name | Description |
---|---|---|
AssetId | id | The identifier. |
System.String | location | The location. |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
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
Type | Name | Description |
---|---|---|
IReference | reference | The content reference. |
Returns
Type | Description |
---|---|
T | T. |
Type Parameters
Name | Description |
---|---|
T |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | reference |
GetAttachedReference(Object)
Gets the reference info of attached to a given object, if it exists.
public static AttachedReference GetAttachedReference(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The object for which to get the attached reference. Can be null, in this case this method returns null. |
Returns
Type | Description |
---|---|
AttachedReference | The AttachedReference attached to the given object if available, |
GetOrCreateAttachedReference(Object)
Gets or creates the object reference info of a given object.
public static AttachedReference GetOrCreateAttachedReference(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The object. |
Returns
Type | Description |
---|---|
AttachedReference |
GetUrl(Object)
Gets the URL of a given object.
public static string GetUrl(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The object. |
Returns
Type | Description |
---|---|
System.String | The URL. |
SetUrl(Object, String)
Sets the URL of a given object.
public static void SetUrl(object obj, string url)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The object. |
System.String | url | The URL. |