I'm looking into doing inter-module communication with DotNetNuke 4.8.4 - and am wondering if anyone has any good examples of doing this.
I understand that you implement IModuleCommunicator on the sender, and IModuleListener on the receiver - but don't see a way to tie them together besides just dropping them both on the same page.
Do ALL of the listeners on a given page listen to ALL of the senders on a given page? If so, what's the best practice for filtering out the noise?
I was just reading up on IMC last night in Mitchel Sellers DotNetNuke Module Programming book.
Here are some of the main takeaways:
Here is an example of sending information:
if (ModuleCommunication != null)
{
var args = new ModuleCommunicationEventArgs();
args.Sender = "Something";
args.Target = "Something Else";
args.Text = "Something";
args.Type = "Something";
args.Value = new Object();
ModuleCommunication(this, args);
}
To filter out the noise you'd want to make sure you include some very specific identifying information. It looks like you have plenty of opportunity to do that though when setting up the the EventArgs to be consumed.