Table of Contents

Class EventHandlerMarshaller<TEventHandler>

Namespace
SampSharp.OpenMp.Core.Api
Assembly
SampSharp.OpenMp.Core.dll

Represents a base class for event handler marshallers. This type is automatically generated by code generated for event handlers decorated with the OpenMpEventHandlerAttribute.

public abstract class EventHandlerMarshaller<TEventHandler> : IEventHandlerMarshaller<TEventHandler> where TEventHandler : class

Type Parameters

TEventHandler

The type of the event handler.

Inheritance
EventHandlerMarshaller<TEventHandler>
Implements
Derived
Inherited Members

Constructors

EventHandlerMarshaller()

protected EventHandlerMarshaller()

Methods

Create(TEventHandler)

Creates the unmanaged counterpart of the specified event handler.

protected abstract (nint, object) Create(TEventHandler handler)

Parameters

handler TEventHandler

The event handler for which to create the unmanaged counterpart.

Returns

(nint, object)

An unmanaged handle and an object of luggage which will be kept so GC won't clean it up.

Free(nint)

Frees the resources associated with the specified unmanaged handle.

protected abstract void Free(nint handle)

Parameters

handle nint

The unmanaged handle to free.

Marshal(TEventHandler)

Marshals the specified managed event handler to a EventHandlerReference<TEventHandler>.

public EventHandlerReference<TEventHandler> Marshal(TEventHandler handler)

Parameters

handler TEventHandler

The managed event handler to marshal.

Returns

EventHandlerReference<TEventHandler>

The unmanaged event handler.