This will be difficult to explain so bear with me. If anyone is
familiar with Tibco Rendezvous and/or Microsoft Messaging, this may
make more sense.
I've created a hierarchy of objects that looks something like this:
Tibco-->Transports-->Transport
Where Tibco is the overall component that owns a collection of
Transports and each Transport is an object of a class.
What I want to be able to do is have an event that will fire at the
Transport level whenever a message is received by the application but
I can't seem to figure out how to add an event to a collection item.
To make this question more generic, I simply want to have an event
attached to a collection item contained inside of a collection.
Here is some code:
public class Tibco : System.Componen tModel.Componen t
{
internal TransportCollec tion transports;
public Tibco()
{
this.transports = new TransportCollec tion();
}
public TransportCollec tion Transports
{
get
{
return this.transports ;
}
}
}
public class TransportCollec tion :
System.Collecti ons.Generic.Lis t<Transport>
{
}
public class Transport
{
private System.String service;
private System.String network;
private System.String daemon;
internal ListenerCollect ion listeners;
public System.String Service
{
get
{
return this.service;
}
set
{
this.service = value;
}
}
public System.String Network
{
get
{
return this.network;
}
set
{
this.network = value;
}
}
public System.String Daemon
{
get
{
return this.daemon;
}
set
{
this.daemon = value;
}
}
public Transport()
{
this.listeners = new ListenerCollect ion();
}
public ListenerCollect ion Listeners
{
get
{
return this.listeners;
}
}
}
What I need is to be able to define an event for the Transport.
Any suggestions?