Language

AndroidEventHelper.RemoveEventHandler<TInterface,TImplementor> Method

Definition

Removes a handler and clears an empty listener by passing null to setListener.

public static void RemoveEventHandler<TInterface,TImplementor>(ref WeakReference? implementor, Func<TImplementor,bool> empty, Action<TInterface?> setListener, Action<TImplementor> remove) where TInterface : class where TImplementor : Java.Lang.Object, TInterface;
static member RemoveEventHandler : WeakReference * Func<'Implementor, bool (requires 'Implementor :> Java.Lang.Object and 'Implementor :> 'Interface)> * Action<'Interface (requires 'Interface : null)> * Action<'Implementor (requires 'Implementor :> Java.Lang.Object and 'Implementor :> 'Interface)> -> unit (requires 'Interface : null and 'Implementor :> Java.Lang.Object and 'Implementor :> 'Interface)

Type Parameters

TInterface

The reference-type listener contract implemented by TImplementor.

TImplementor

The Java.Lang.Object-derived listener implementation.

Parameters

implementor
WeakReference

The weak implementor reference to clear when no handlers remain.

empty
Func<TImplementor,Boolean>

Tests whether the implementor has no handlers after removal.

setListener
Action<TInterface>

Receives null to clear the listener when its implementor becomes empty.

remove
Action<TImplementor>

Removes the event handler from the implementor.

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to