Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Before/AfterBlock hooks #37

Open
maciejmatuszak opened this issue Dec 11, 2020 · 0 comments
Open

Before/AfterBlock hooks #37

maciejmatuszak opened this issue Dec 11, 2020 · 0 comments

Comments

@maciejmatuszak
Copy link

In order to visualise/log the running script it would be handy to have before/after hooks .

  • Add Before After hooks to Block model (those will apply to specific block)
  • Add Before After hooks to Context model (those will apply to every block)
  • Before/After method should have access to Context

Hook Implementation:

  • Option one: use nullable Func variables or delegates reference in models, easy to check for null and execute if not null

  • Option two: Use EventHandlers and delegates

    • Should be fastest method? widely used for time sensitive events lime mouse interaction
    • build in handling of empty handler
  • Option three: Add Before/After abstract method to base block and context models, let implementation override it.

    • waste of resources if hooks are not used as the abstract method would always be called
    • Possible to use interfaces IBeforeAction, IAfterAction, implemented interfaces can be detected, still I imagine simple null check is faster.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant