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 Event
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
1918 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
1951 Views
no comments
 
C#
namespace Nowcom.Quicksilver
{
  public interface IMessage
  {
  }
}
 
namespace Nowcom.Quicksilver
{
    using System.ComponentModel.Composition;
652 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
1188 Views
no comments
 
[system.diagnostics.eventlog]::Delete("MyCustomLog")
by Markus   October 26, 2009 @ 6:15am
233 Views
no comments
 
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace ConsoleApplication1
{
    public class T3
    {
        public delegate void del1();
by afsharm   September 30, 2009 @ 3:36am
294 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
525 Views
no comments
 
C#
private static PropertyChangedEventArgs CurrentItemChangedEventArgs = new PropertyChangedEventArgs("CurrentItem");
private static PropertyChangedEventArgs CurrentPositionChangedEventArgs = new PropertyChangedEventArgs("CurrentPosition");
private static PropertyChangedEventArgs IsCurrentBeforeFirstChangedEventArgs = new PropertyChangedEventArgs("IsCurrentBeforeFirst");
 
...
 
this.PropertyChanged(this, CurrentItemChangedEventArgs);
this.PropertyChanged(this, CurrentPositionChangedEventArgs);
this.PropertyChanged(this, IsCurrentBeforeFirstChangedEventArgs);
by Jeff Handley   August 14, 2009 @ 12:15am
405 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