Table of contents
TOC
Collapse the table of content
Expand the table of content

RuntimeHelpers.CreateEvent<'Delegate,'Args> Function (F#)

Den Delimarsky|Last Updated: 8/18/2017
|
1 Contributor

Creates an anonymous event with the given handlers.

Namespace/Module Path: Microsoft.FSharp.Core.CompilerServices.RuntimeHelpers

Assembly: FSharp.Core (in FSharp.Core.dll)

Syntax

// Signature:
RuntimeHelpers.CreateEvent : ('Delegate -> unit) -> ('Delegate -> unit) -> ((obj -> 'Args -> unit) -> 'Delegate) -> IEvent<'Delegate,'Args> (requires delegate)

// Usage:
RuntimeHelpers.CreateEvent addHandler removeHandler createHandler

Parameters

addHandler Type: 'Delegate ->unit

A function to handle adding a delegate for the event to trigger.

removeHandler Type: 'Delegate ->unit

A function to handle removing a delegate that the event triggers.

createHandler Type: (obj-> 'Args ->unit) -> 'Delegate

A function to produce the delegate type the event can trigger.

Return Value

The initialized event as an object that implements IEvent.

Remarks

Platforms

Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2

Version Information

F# Core Library Versions

Supported in: 2.0, 4.0, Portable

See Also

CompilerServices.RuntimeHelpers Module (F#)

Microsoft.FSharp.Core.CompilerServices Namespace (F#)

© 2018 Microsoft