1

Register one SignalHandler for multiple Members?

asked 2015-05-30 02:21:50 -0700

riko642 gravatar image

Is it possible?

 AllJoynScript.sMsgBus.RegisterSignalHandler(SignalHandler, Member1, null);
 AllJoynScript.sMsgBus.RegisterSignalHandler(SignalHandler, Member2, null);

Right now, it returns error :

An element with the same key already exists in the dictionary.

Example: One SignalHandler could handle multiple signals and then, based on their data, it could decide what to do next. Right now, for every Member, a new SignalHandler needs to be created, even though their content may be identical.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2015-05-30 02:59:50 -0700

riko642 gravatar image

updated 2015-05-30 03:00:22 -0700

I have found one solution that works, but I'm not sure if it is ideal, or if it has any downsides.

AllJoynScript.sMsgBus.RegisterSignalHandler(delegate(AllJoyn.InterfaceDescription.Member a, string b, AllJoyn.Message c) {  SignalHandler(a, b, c); }, Member1, null);
AllJoynScript.sMsgBus.RegisterSignalHandler(delegate(AllJoyn.InterfaceDescription.Member a, string b, AllJoyn.Message c)  { SignalHandler(a, b, c); }, Member2, null);

Any feedback/opinion?

edit flag offensive delete publish link more
Login/Signup to Answer

Question Tools

Follow
1 follower

Stats

Asked: 2015-05-30 02:21:50 -0700

Seen: 21 times

Last updated: May 30 '15