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
IXPSimpleObjectAn 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
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
SessionA Session object to which the target belongs.
target
objectAn 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
TargetKeyValue
[NonPersistent]
protected object TargetKeyValue
Field Value
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
TargetType
[PersistentAlias("TargetType_")]
protected XPObjectType TargetType { get; set; }
Property Value
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
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