Hello,
Using FBClient 2.0.1.0 which we are stuck with at the moment.
When registering multiple events the only way we can seem to make it
work is if we make the call and create a new static array during the
create as in this example:
public FbRemoteEvent DBEventListener;
DBEventListener = new FbRemoteEvent(ServiceDBConnection, new string[]
{"EVENT1", "EVENT2", "EVENT3", "EVENT4"});
The issue is that we may have several different events to register and
they are not always the same so we would like to pass a dynamically
created array of event names as in this example:
int arraylength = 4;//initialize to 4 for constant events
"EVENT1","EVENT2","EVENT3","EVENT4"
//check for other events on this database
if (ListenForEvent5)
{
arraylength++;
}
if (ListenForEvent6)
{
arraylength++;
}
if (ListenForEvent7)
{
arraylength++;
}
if (ListenForEvent8)
{
arraylength++;
}
if (ListenForEvent9)
{
arraylength++;
}
if (ListenForEvent10)
{
arraylength++;
}
string[] EventArray = new string[arraylength];
EventArray[0] = "EVENT1";
EventArray[1] = "EVENT2";
EventArray[2] = "EVENT3";
EventArray[3] = "EVENT4";
int arraycounter = 4;//start at position 4 which is 5th element in array
if (ListenForEvent5)
{
EventArray[arraycounter] = "EVENT5";
arraycounter++;
}
if (ListenForEvent6)
{
EventArray[arraycounter] = "EVENT6";
arraycounter++;
}
if (ListenForEvent7)
{
EventArray[arraycounter] = "EVENT7";
arraycounter++;
}
if (ListenForEvent8)
{
EventArray[arraycounter] = "EVENT8";
arraycounter++;
}
if (ListenForEvent9)
{
EventArray[arraycounter] = "EVENT9";
arraycounter++;
}
if (ListenForEvent10)
{
EventArray[arraycounter] = "EVENT10";
arraycounter++;
}
DBEventListener = new FbRemoteEvent(ServiceDBConnection,EventArray);
The problem is that passing in the EventArray does not seem to work. The
only event that is ever picked up is the first one. None of the other
events appears to be heard.
Any suggestions on how to do this cleanly without having to write a
large, messy procedure to check for all the possible combinations of
events and register the events statically? How do other people register
dynamically changing event names?
Thanks for any assistance or advice.
Todd Asher
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Firebird-net-provider mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider