CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of EventAggregator
C#
/*
  some simple helpers to clean up the syntax / remove the need for the Get<Event> pattern. Works with pure poco event classes.
  Inspired by this post from Ward Bell: http://neverindoubtnet.blogspot.com/2009/07/simplify-prism-event-aggregator.html
 
 
  example usage given an OrderCreated event
 
  //Given this event:
  public class OrderCreated{
    public Order Order {get;set;}
by Glenn Block   October 10, 2010 @ 9:20pm
1741 Views
no comments
 
C#
/*
 
  See the updated version at: http://codepaste.net/woqq1d which supports mocking.
 
  some simple helpers to clean up the syntax / remove the need for the Get<Event> pattern. Works with pure poco event classes.
  Inspired by this post from Ward Bell: http://neverindoubtnet.blogspot.com/2009/07/simplify-prism-event-aggregator.html
 
 
  example usage given an OrderCreated event
by Glenn Block   October 10, 2010 @ 4:00pm
1781 Views
no comments
 
C#
namespace Nowcom.Quicksilver
{
  public interface IMessage
  {
  }
}
 
namespace Nowcom.Quicksilver
{
    using System.ComponentModel.Composition;
595 Views
no comments
 
C#
using System.ComponentModel.Composition;
using Microsoft.Practices.Composite.Events;
 
//this version uses a static backing field so that the instance is automatically shared across all containers.
public class EventAggregatorPart
{
    private static IEventAggregator _eventAggregator;
 
    static EventAggregatorPart()
    {   
by Glenn Block   January 10, 2010 @ 11:30pm
1090 Views
no comments
 
C#
[TestClass]
public class MefEventAggregatorTestFixture
{
    [TestMethod]
    public void Subscriber_is_invoked_when_publisher_raises_event()
    {
       var catalog = new InterceptingCatalog(
            new TypeCatalog(typeof(EventAggregator), typeof (FakePublisher), typeof (MockSubscriber))
            );
        var container = new CompositionContainer(catalog);
by Glenn Block   September 01, 2009 @ 6:22pm
482 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate