¡@

Home 

c# Programming Glossary: publisher

Weak event handler model for use with lambdas

http://stackoverflow.com/questions/1747235/weak-event-handler-model-for-use-with-lambdas

version with comments public static void Link Publisher publisher Control subscriber var subscriber_weak_ref new WeakReference.. Publisher sender .EnabledChanged handler handler null publisher.EnabledChanged handler What bothered me was that the event is.. S T Action EventHandler T add to add event listener to publisher Action EventHandler T remove to remove event listener from publisher..

Do event handlers stop garbage collection from occuring?

http://stackoverflow.com/questions/298261/do-event-handlers-stop-garbage-collection-from-occuring

has no effect on the collection of pClass as the publisher . For GC in general in particular the target it depends whether.. to be a problem. Note that this is one way i.e. if we have publisher.SomeEvent target.SomeHandler then publisher will keep target.. if we have publisher.SomeEvent target.SomeHandler then publisher will keep target alive but target will not keep publisher alive...

Garbage collection when using anonymous delegates for event handling

http://stackoverflow.com/questions/371109/garbage-collection-when-using-anonymous-delegates-for-event-handling

question . Original question In my code I have an event publisher which exists for the whole lifetime of the application here.. ValueEventArgs bool EnabledChanged Because this publisher can be used all over the place I was quite pleased with myself.. static class Linker public static void Link Publisher publisher Control subscriber publisher.EnabledChanged s e subscriber.Enabled..

Why and How to avoid Event Handler memory leaks?

http://stackoverflow.com/questions/4526829/why-and-how-to-avoid-event-handler-memory-leaks

simple to explain while an event handler is subscribed the publisher of the event holds a reference to the subscriber via the event.. assuming the delegate is an instance method . If the publisher lives longer than the subscriber then it will keep the subscriber.. actually a problem because typically I find that the publisher and subscriber have roughly equal lifetimes anyway. It is a..

Associating enums with strings in C#

http://stackoverflow.com/questions/630803/associating-enums-with-strings-in-c-sharp

Use of null check in event handler

http://stackoverflow.com/questions/672638/use-of-null-check-in-event-handler

requiring it. In terms of garbage collection the event publisher ends up with a reference to the event subscriber i.e. the target.. the target of the handler . This is only a problem if the publisher is meant to live longer than the subscriber. share improve..

Event Signature in .NET — Using a Strong Typed 'Sender'?

http://stackoverflow.com/questions/1046016/event-signature-in-net-using-a-strong-typed-sender

a standard event signature that looks like this class Publisher public event EventHandler PublisherEventArgs SomeEvent I am.. looks like this class Publisher public event EventHandler PublisherEventArgs SomeEvent I am considering using an event signature.. in a publishing class as follows class Publisher public event StrongTypedEventHandler Publisher PublisherEventArgs..

Weak event handler model for use with lambdas

http://stackoverflow.com/questions/1747235/weak-event-handler-model-for-use-with-lambdas

see link for version with comments public static void Link Publisher publisher Control subscriber var subscriber_weak_ref new WeakReference.. null subscriber_strong_ref.Enabled e.Value else Publisher sender .EnabledChanged handler handler null publisher.EnabledChanged..

Garbage collection when using anonymous delegates for event handling

http://stackoverflow.com/questions/371109/garbage-collection-when-using-anonymous-delegates-for-event-handling

application here reduced to bare essentials public class Publisher ValueEventArgs T inherits from EventArgs public event EventHandler.. public static class Linker public static void Link Publisher publisher Control subscriber publisher.EnabledChanged s e subscriber.Enabled.. not comfortable with lambdas public static void Link Publisher publisher Control subscriber publisher.EnabledChanged delegate..