Example #1
0
            public EventDispatcher(Property <V> property, EventQueue dispatcher, EventHandler handler)
            {
                this.Property   = property;
                this.Dispatcher = dispatcher;
                this.Handler    = dispatcher != null
                    ? delegate(Property <V> .EventArgs args) { dispatcher.Post(delegate() { handler(args); }); }
                    : handler;

                this.Property.Changed += this.Handler;
            }
Example #2
0
            public RemovedEventDispatcher(Collection <V> collection, EventQueue dispatcher, RemovedEventHandler handler)
            {
                this.Collection = collection;

                this.Handler = dispatcher != null
                    ? delegate(Collection <V> .RemovedEventArgs args) { dispatcher.Post(delegate() { handler(args); }); }
                    : handler;

                this.Collection.Removed += this.Handler;
            }