コード例 #1
0
ファイル: RoomI.cs プロジェクト: spolnik/Chat_Ice_ZeroC
        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);
                }
            }
        }
コード例 #2
0
ファイル: RoomV2I.cs プロジェクト: hwz121212/Chat_Ice_ZeroC
        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);
                }
            }
        }