This extension adds support for bbv.Common.EventBroker.
License
ninject/Ninject.Extensions.BbvEventBroker
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
master
Could not load branches
Nothing to show
Could not load tags
Nothing to show
{{ refName }}
default
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code
-
Clone
Use Git or checkout with SVN using the web URL.
Work fast with our official CLI. Learn more about the CLI.
- Open with GitHub Desktop
- Download ZIP
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
This extension adds support for bbv.Common.EventBroker. This is a component that allows communication between components using events without knowing each other directly to register these events themself. See http://code.google.com/p/bbvcommon/wiki/EventBroker. It requires Ninject.Extensions.NamedScope and Ninject.Extensions.ContextPreservation. The extension adds funtionality to create event broker instances and to register objects at creation on one or more of these event broker instances. There are two ways to create an instance of an event broker: First, global event broker instances. This type of event broker has the same lifecicle as the kernel: this.kernel.AddGlobalEventBroker("MyGlobalEventBroker"); this.kernel.Bind<Component1>().ToSelf().RegisterOnEventBroker("MyGlobalEventBroker"); this.kernel.Bind<Component2>().ToSelf().RegisterOnEventBroker("MyGlobalEventBroker"); Or in case one global event broker is enough: this.kernel.AddDefaultGlobalEventBroker(); this.kernel.Bind<Component1>().ToSelf().RegisterOnGlobalEventBroker(); this.kernel.Bind<Component2>().ToSelf().RegisterOnGlobalEventBroker(); Second, local event broker instances. These instances are created whenever an instance of its owner is created. All objects created as dependencies can use this instance to communicate. If a second instance of the owner is created these objects have thery own event broker so that the communication i sepatated from the first set of objects: const string EventBrokerName = "LocalEB1"; Example: this.kernel.Bind<Parent>().ToSelf().OwnsEventBroker(EventBrokerName); this.kernel.Bind<Component1>().ToSelf().RegisterOnGlobalBroker(EventBrokerName); this.kernel.Bind<Component2>().ToSelf().RegisterOnGlobalBroker(EventBrokerName); var parent1 = this.kernel.Get<Parent>(); var parent2 = this.kernel.Get<Parent>(); In this case if parents component1 fires an event it will be receives by parent1.component2 but not parent2.component2 or parent2.component1 Forthermore its possible to inject the event broker to the created instances in case you to do something more special. Therefore create a parameter that has the same name as the event broker. The name is case insensitive. The name of the global event broker is GlobalEventBroker.
About
This extension adds support for bbv.Common.EventBroker.
Resources
License
Stars
Watchers
Forks
Packages 0
No packages published