Skip to content

Instantly share code, notes, and snippets.

@ionoy
Created October 4, 2012 16:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ionoy/3834692 to your computer and use it in GitHub Desktop.
Save ionoy/3834692 to your computer and use it in GitHub Desktop.
macro HandleOnce(eventName, eventArgs, body)
syntax ("handle", eventName, eventArgs, "once", body)
{
HandleImpl.OnceImpl(eventName, eventArgs, body);
}
macro Handle(eventName, eventArgs, body)
syntax ("handle", eventName, eventArgs, body)
{
HandleImpl.Impl(eventName, eventArgs, body);
}
macro HandleUntil(eventName, eventArgs, untilEventName, body)
syntax ("handle", eventName, eventArgs, "until", untilEventName, body)
{
HandleImpl.UntilImpl(eventName, eventArgs, untilEventName, body);
}
macro HandleThrottle(eventName, eventArgs, throttleDelay : int, body)
syntax ("handle", eventName, eventArgs, "delay", throttleDelay, body)
{
HandleImpl.Impl(eventName, eventArgs, body, throttleDelay);
}
macro HandleUntilThrottle(eventName, eventArgs, untilEventName, throttleDelay : int, body)
syntax ("handle", eventName, eventArgs, "until", untilEventName, "delay", throttleDelay, body)
{
HandleImpl.UntilImpl(eventName, eventArgs, untilEventName, body, throttleDelay);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment