c# - WCF client Multi Event Problem -
my problem events wcf client. hand client object classes. , in classes created events. if created in different classes same event it's fires many times. want event fires in class call wcf.
how can solve problem? remove each event after complete?
sry english ;)
thanks....
hi don't understand question quite well, i'll try answer way did. when reference wcf service, know proxy classes generated in client project. proxy classes share same data member's interface on server-side, not behavior. instance, properties accessible client, not events, methods , on. maybe can write trying accomplish , may help?
update
ok, think understand. that's solution remove each event shouldn't fire before execute addnumber method. solution keep track of calling classes. example
public static arraylist eventobjects = new arraylist(); //declare global array list accessible classes eventobjects.add(this); //before calling addnumber method _client.addnumber += new eventhandler<addnumbercompletedeventargs>(_client_addnumbercompleted); void _client_addnumbercompleted(object sender, addnumbercompletedeventargs e) { if(ar.contains(this)) { //do want here. other classes receive event too, not react. eventobjects.remove(this); } }
however must warn not best approach. can't suggest better way because don't know trying accomplish.
Comments
Post a Comment