Coder Social home page Coder Social logo

ninject.extensions.weakeventmessagebroker's Introduction

ninject.extensions.weakeventmessagebroker's People

Contributors

iappert avatar idavis avatar remogloor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ninject.extensions.weakeventmessagebroker's Issues

Feature Request: Invoke property on Subscribe attribute to run methods on GUI threads.

When annotating methods on classes that extend Control or DispatcherObject it would be really nice if there was a way to mark the methods as requiring Invoke to be called. At present one has to add boiler plate to each subscription to check InvokeRequire and then Invoke if appropriate.

E.g. [Subscribe("message://UpdateAvailable", Invoke=true)]

The broker could check the MethodInfo's declaring class and if extends Control or DispatcherObject it could delegate to the Invoke call. It might even be nice to have a second property "ASync" which would call the events using BeginInvoke.

On this theme a flag to specify that the event should be run on the ThreadPool could also be useful.

Is this feasible?

Incorrect method signature throw cryptic InvalidProgramException.

At present if you try to subscribe to a MessageChannel with the incorrect method signature you'll receive an InvalidProgramException: JIT Compiler encountered an internal limitation.

The MessageChannel could check when an event/method is registered that the method matches the form required. e.g. void EventHandler(object sender, EventArgs args).

A further extension to this would be to record the first method/event signature registered for a channel and to check all subsequent registrations match the first and throw a descriptive ActivationException if not.

N.B when compiled with NO_LCG the reflection based transport will throw a more informative exception about the method signatures having different numbers of parameters.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.