Table of Contents

Class XPWeakReference

Namespace
DevExpress.Xpo
Assembly
DevExpress.Xpo.v24.1.dll

A persistent weak reference to a persistent object.

[MemberDesignTimeVisibility(false)]
public class XPWeakReference : XPCustomObject, IXPObject, IXPSimpleObject, IXPClassInfoAndSessionProvider, IXPClassInfoProvider, ISessionProvider, IObjectLayerProvider, IDataLayerProvider, IXPDictionaryProvider, IXPCustomPropertyStore, IXPModificationsStore, IXPInvalidateableObject, IXPReceiveOnChangedFromDelayedProperty, IXPReceiveOnChangedFromArbitrarySource, INotifyPropertyChanged, IXPImmutableHashCode, IEditableObject, ICustomTypeDescriptor, IComparable, IXPReceiveOnChangedFromXPPropertyDescriptor, IXPOServiceClass
Inheritance
XPWeakReference
Implements
Inherited Members

Constructors

XPWeakReference()

Initializes a new instance of the XPWeakReference class with the default settings.

public XPWeakReference()

XPWeakReference(IXPSimpleObject)

Initializes a new instance of the XPWeakReference class with the specified targeted object.

public XPWeakReference(IXPSimpleObject target)

Parameters

target IXPSimpleObject

An object that will be referenced by the newly created XPWeakReference object. This value is used to initialize the XPWeakReference.Target property.

XPWeakReference(Session)

Initializes a new instance of the XPWeakReference class with the specified session.

public XPWeakReference(Session session)

Parameters

session Session

A Session object to which the created reference belongs.

XPWeakReference(Session, object)

Initializes a new instance of the XPWeakReference class with the specified session and targeted object.

public XPWeakReference(Session session, object target)

Parameters

session Session

A Session object to which the target belongs.

target object

An object that will be referenced by the newly created XPWeakReference object. This value is used to initialize the XPWeakReference.Target property.

Fields

Oid

A key of the current weak reference.

[Key(true)]
public Guid Oid

Field Value

Guid

TargetKeyValue

[NonPersistent]
protected object TargetKeyValue

Field Value

object

Properties

IsAlive

Gets whether the object referenced by this instance has been garbage collected.

[NonPersistent]
public bool IsAlive { get; }

Property Value

bool

true if the referenced object has been garbage collected; otherwise, false.

Target

Gets or sets the object referenced by the current XPWeakReference instance.

[NonPersistent]
public object Target { get; set; }

Property Value

object

An object referenced by the current XPWeakReference instance.

TargetKey

[PersistentAlias("TargetKey_")]
protected virtual string TargetKey { get; set; }

Property Value

string

TargetType

[PersistentAlias("TargetType_")]
protected XPObjectType TargetType { get; set; }

Property Value

XPObjectType

Methods

KeyToString(object)

This method supports the internal infrastructure and is not intended to be used direcly from your code.

public static string KeyToString(object key)

Parameters

key object

Returns

string

StringToKey(string)

This method supports the internal infrastructure and is not intended to be used direcly from your code.

public static object StringToKey(string s)

Parameters

s string

Returns

object