M
meyousikmann
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.ComponentModel.Component
{
internal TransportCollection transports;
public Tibco()
{
this.transports = new TransportCollection();
}
public TransportCollection Transports
{
get
{
return this.transports;
}
}
}
public class TransportCollection :
System.Collections.Generic.List<Transport>
{
}
public class Transport
{
private System.String service;
private System.String network;
private System.String daemon;
internal ListenerCollection 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 ListenerCollection();
}
public ListenerCollection Listeners
{
get
{
return this.listeners;
}
}
}
What I need is to be able to define an event for the Transport.
Any suggestions?
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.ComponentModel.Component
{
internal TransportCollection transports;
public Tibco()
{
this.transports = new TransportCollection();
}
public TransportCollection Transports
{
get
{
return this.transports;
}
}
}
public class TransportCollection :
System.Collections.Generic.List<Transport>
{
}
public class Transport
{
private System.String service;
private System.String network;
private System.String daemon;
internal ListenerCollection 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 ListenerCollection();
}
public ListenerCollection Listeners
{
get
{
return this.listeners;
}
}
}
What I need is to be able to define an event for the Transport.
Any suggestions?