public override void Say(string message, Current current) { lock (this) { string author = current.ctx[AUTHORCTXPROP.value]; if (!this.ListenerPrxs.ContainsKey(author)) throw new IllegalChatSessionException("You are not a member", current.ctx[SESSIONCTXPROP.value]); Post post = new Post(current.ctx[AUTHORCTXPROP.value], message, 0); foreach (string key in this.ListenerPrxs.Keys) { IListenerCallback listenerCallback = new ListenerCallback(); this.ListenerPrxs[key].begin_NotifyPost(post).whenCompleted(listenerCallback.SayCallback, listenerCallback.FailureCallback); } } }
public override void Say(string message, long time, Current current) { lock (this) { string author = current.ctx[AUTHORCTXPROP.value]; if (!this._listenerPrxs.ContainsKey(author)) { throw new IllegalChatSessionException("You are not a member", current.ctx[SESSIONCTXPROP.value]); } Post post = new Post(current.ctx[AUTHORCTXPROP.value], message, time); foreach (string key in this._listenerPrxs.Keys) { IListenerCallback listenerCallback = new ListenerCallback(); this._listenerPrxs[key].begin_NotifyPost(post).whenCompleted(listenerCallback.SayCallback, listenerCallback.FailureCallback); } } }