using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq;
using com.sun.star.uno; using com.sun.star.lang;
namespace com.sun.star.uno.helper
{ // This class can be used as a helper base class for UNO interfaces. // It allows taking weak references to the object (com.sun.star.uno.XWeak) // and using the object from StarBasic (com.sun.star.lang.XTypeProvider). publicclass WeakBase : IQueryInterface, XWeak, XTypeProvider
{ private WeakAdapter _adapter;
~WeakBase() => _adapter?.RaiseTargetDestructing();
// An XAdapter implementation that holds a weak reference to an interface. privateclass WeakAdapter : IQueryInterface, XAdapter
{ privateevent Action _onDispose;
private WeakReference<IQueryInterface> _weakRef; public WeakAdapter(IQueryInterface obj)
=> _weakRef = new WeakReference<IQueryInterface>(obj);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.