Class to handle/manipulate events of other classes

Makavelli

Member
Joined
Apr 25, 2005
Messages
10
Programming Experience
1-3
My dilemma:
I have a project I'm working on with friends but we are in separate locations.

The idea is to create the forms independently and be able to tell a "control panel" class the events they wish to subscribe to from other forms. Basically have a main form that can handle and redirect events from all the forms - a way for all the forms to communicate with each other dynamically

For instance

Class Son:
  • Wants to subscribe to NeedsHelp and WillGiveMoney events in the Dad class
  • Wants to subscribe to BakedCookies and WillGiveAdvice events in the Mum class
  • Wants Dad and Mum class to be able to subscribe to its ReceivedAllAs, IsBroke and NeedsFood events
Class Dad:
  • Wants to subscribe to FailedClasses and ReceivedAllAs from Son class
  • Wants to subscribe to InBadMood and BakedCookies from Mum class
  • Wants Son and Mum to be able to subscribe to its InBadMood and NeedsHelp events
Class Mum:
  • Wants to subscribe to FailedClasses, ReceivedAllAs, IsBroke and NeedsFood from Son Class
  • Wants to subscribe to InBadMood and GotRaise from Dad class
  • Wants Dad and Son to be able to subscribe to its InGoodMood, InBadMood, DiamondForMum and ClothForMum events
Big Question:
I know how to subscribe to 1-to-1 subscription but I don't know how I can redirect subscriptions dynamically. How can I accomplish this?

Thanks
 
Back
Top