Class BaseShareableDisposable<TSelf>
- Namespace
- CarinaStudio
- Assembly
- CarinaStudio.AppBase.Core.dll
Base implementation of IShareableDisposable<TSelf>.
public abstract class BaseShareableDisposable<TSelf> : BaseDisposable, IShareableDisposable<TSelf>, IDisposable where TSelf : IShareableDisposable<TSelf>
Type Parameters
TSelf
Self type.
- Inheritance
-
BaseShareableDisposable<TSelf>
- Implements
-
IShareableDisposable<TSelf>
- Inherited Members
- Extension Methods
Constructors
BaseShareableDisposable(BaseResourceHolder)
Initialize new BaseShareableDisposable<TSelf> instance.
protected BaseShareableDisposable(BaseShareableDisposable<TSelf>.BaseResourceHolder resourceHolder)
Parameters
resourceHolder
BaseShareableDisposable<TSelf>.BaseResourceHolderResource holder.
Methods
Dispose(bool)
Dispose the instance.
protected override void Dispose(bool disposing)
Parameters
disposing
boolTrue to dispose managed resources also.
~BaseShareableDisposable()
Finalize BaseShareableDisposable<TSelf> instance.
protected ~BaseShareableDisposable()
GetResourceHolder<T>()
Get resource holder as specific type.
protected T GetResourceHolder<T>() where T : BaseShareableDisposable<TSelf>.BaseResourceHolder
Returns
- T
Resource holder.
Type Parameters
T
Specific type of BaseShareableDisposable<TSelf>.BaseResourceHolder.
Share()
Create a new instance which shares internal resources.
public TSelf Share()
Returns
- TSelf
New instance which shares internal resources.
Share(BaseResourceHolder)
Create a new instance which shares internal resources.
protected abstract TSelf Share(BaseShareableDisposable<TSelf>.BaseResourceHolder resourceHolder)
Parameters
resourceHolder
BaseShareableDisposable<TSelf>.BaseResourceHolderResource holder.
Returns
- TSelf
New instance which shares internal resources.