The OwnerValue is used on properties to declare ownership of disposable objects.
sealed class
|
OwnerValue
|
extends
|
Attribute
|
The following rules depict - based on the ownership status - when a disposable object must be disposed and when disposal must not be performed. Going by these rules will avoid situations where a resource is disposed although it is still being used and situations when a resource is never explicitly disposed, thus wasting system resources.
... [OwnerValue] IDisposable MyObj { set { ... } } ... [OwnerValue] IDisposable MyObj { set { ... } get { ... } } ...The property takes ownership on the object that is passed to it as the
value
,
so
the
storage
container
from
which
the
value
has
originated
is
no
longer
responsible
for
disposal.
See also:
Owner