是否正常的 firebird 服务器在引发任何已注册事件时发送所有已注册事件计数?
以 firebirds 网站为例,我是这样做的:
class FirebirdListenerTest
{
public FirebirdListenerTest()
{
try
{
FbConnectionStringBuilder cs = new FbConnectionStringBuilder();
cs.DataSource = "localhost";
cs.Database = "C:\\FIREBIRD\\TEST.GDB";
cs.UserID = "SYSDBA";
cs.Password = "masterkey";
cs.Charset = "NONE";
FbConnection connection = new FbConnection(cs.ToString());
connection.Open();
FbRemoteEvent revent = new FbRemoteEvent(connection);
revent.AddEvents(new string[] { "text_changed", "text_inserted", "justtest_event" });
// Add callback to the Firebird events
revent.RemoteEventCounts += new FbRemoteEventEventHandler(EventCounts);
// Queue events
revent.QueueEvents();
Console.ReadLine();
connection.Close();
}
catch (Exception e)
{
Debug.WriteLine(e.ToString());
}
}
static void EventCounts(object sender, FbRemoteEventEventArgs args)
{
Console.WriteLine("Event {0} has {1} counts.", args.Name, args.Counts);
}
}
在这样的代码中,如果引发任何事件,我总是会得到所有事件的计数。它应该如何运作?
最佳答案
是的。您可以根据 Counts 属性对其进行过滤,它可以是 0-n。
关于c# - Firebird 在 .NET 中发送所有事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11202818/