LibreOffice Module cli_ure (master) 1
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
uno.util.WeakComponentBase Class Reference

This class can be used as a base class for UNO objects. More...

Inheritance diagram for uno.util.WeakComponentBase:
[legend]
Collaboration diagram for uno.util.WeakComponentBase:
[legend]

Public Member Functions

void dispose ()
 This method is called by the owner of this object to explicitly dispose it. More...
 
void addEventListener (XEventListener xListener)
 Registers an event listener being notified when this object is disposed. More...
 
void removeEventListener (XEventListener xListener)
 Revokes an event listener from being notified when this object is disposed. More...
 
- Public Member Functions inherited from uno.util.WeakBase
XAdapter queryAdapter ()
 The returned XAdapter implementation can be used to keap a weak reference to this object. More...
 
Type[] getTypes ()
 Returns an array of Type objects which represent all implemented UNO interfaces of this object. More...
 
byte[] getImplementationId ()
 
override String ToString ()
 

Protected Member Functions

bool isDisposed ()
 Indicates whether object is already disposed. More...
 
void checkUnDisposed ()
 Checks whether this object is disposed and throws a DisposedException if it is already disposed. More...
 
void preDisposing ()
 Override to perform extra clean-up work. More...
 
void postDisposing ()
 Override to become notified right before the disposing action is performed. More...
 

Private Member Functions

delegate void t_disposing (EventObject evt)
 
 ~WeakComponentBase ()
 

Private Attributes

t_disposing m_disposing = null
 
bool m_inDispose = false
 
bool m_disposed = false
 

Additional Inherited Members

- Static Protected Attributes inherited from uno.util.WeakBase
static Hashtable s_types = new Hashtable()
 
static Hashtable s_impl_ids = new Hashtable()
 

Detailed Description

This class can be used as a base class for UNO objects.

It implements the capability to be kept weakly (unoidl.com.sun.star.uno.XWeak) and it implements unoidl.com.sun.star.lang.XTypeProvider which is necessary for using the object from StarBasic. In addition, it implements the interface unoidl.com.sun.star.lang.XComponent to be disposed explicitly.

Definition at line 33 of file WeakComponentBase.cs.

Constructor & Destructor Documentation

◆ ~WeakComponentBase()

uno.util.WeakComponentBase.~WeakComponentBase ( )
inlineprivate

Member Function Documentation

◆ addEventListener()

void uno.util.WeakComponentBase.addEventListener ( XEventListener  xListener)
inline

Registers an event listener being notified when this object is disposed.

Parameters
xListenerevent listener

Definition at line 158 of file WeakComponentBase.cs.

References lock(), uno.util.WeakComponentBase.m_disposed, uno.util.WeakComponentBase.m_disposing, uno.util.WeakComponentBase.m_inDispose, and uno.util.WeakComponentBase.t_disposing().

◆ checkUnDisposed()

void uno.util.WeakComponentBase.checkUnDisposed ( )
inlineprotected

Checks whether this object is disposed and throws a DisposedException if it is already disposed.

Definition at line 56 of file WeakComponentBase.cs.

References uno.util.WeakComponentBase.isDisposed().

◆ dispose()

void uno.util.WeakComponentBase.dispose ( void  )
inline

This method is called by the owner of this object to explicitly dispose it.

This implementation of dispose() first notifies this object via preDisposing(), then all registered event listeners and finally this object again calling postDisposing().

Definition at line 98 of file WeakComponentBase.cs.

References lock(), uno.util.WeakComponentBase.m_disposed, uno.util.WeakComponentBase.m_disposing, uno.util.WeakComponentBase.m_inDispose, uno.util.WeakComponentBase.postDisposing(), uno.util.WeakComponentBase.preDisposing(), and uno.util.WeakComponentBase.t_disposing().

Referenced by uno.util.WeakComponentBase.~WeakComponentBase().

◆ isDisposed()

bool uno.util.WeakComponentBase.isDisposed ( )
inlineprotected

Indicates whether object is already disposed.

Returns
true, if object has been disposed

Definition at line 45 of file WeakComponentBase.cs.

References lock(), and uno.util.WeakComponentBase.m_disposed.

Referenced by uno.util.WeakComponentBase.checkUnDisposed().

◆ postDisposing()

void uno.util.WeakComponentBase.postDisposing ( )
inlineprotected

Override to become notified right before the disposing action is performed.

Definition at line 88 of file WeakComponentBase.cs.

Referenced by uno.util.WeakComponentBase.dispose().

◆ preDisposing()

void uno.util.WeakComponentBase.preDisposing ( )
inlineprotected

Override to perform extra clean-up work.

Provided for subclasses. It is called during dispose()

Definition at line 81 of file WeakComponentBase.cs.

Referenced by uno.util.WeakComponentBase.dispose().

◆ removeEventListener()

void uno.util.WeakComponentBase.removeEventListener ( XEventListener  xListener)
inline

Revokes an event listener from being notified when this object is disposed.

Parameters
xListenerevent listener

Definition at line 175 of file WeakComponentBase.cs.

References lock(), uno.util.WeakComponentBase.m_disposed, uno.util.WeakComponentBase.m_disposing, uno.util.WeakComponentBase.m_inDispose, and uno.util.WeakComponentBase.t_disposing().

◆ t_disposing()

delegate void uno.util.WeakComponentBase.t_disposing ( EventObject  evt)
private

Member Data Documentation

◆ m_disposed

bool uno.util.WeakComponentBase.m_disposed = false
private

◆ m_disposing

t_disposing uno.util.WeakComponentBase.m_disposing = null
private

◆ m_inDispose

bool uno.util.WeakComponentBase.m_inDispose = false
private

The documentation for this class was generated from the following file: