예제 #1
0
        protected virtual void OnSending(SendingEventArgs <T> e)
        {
            var handler = this.Sending;

            if (handler != null)
            {
                handler(this, e);
            }
        }
예제 #2
0
        private void OnSendingPlace(object sender, SendingEventArgs <PlaceSendMessage> e)
        {
            var b = e.Message;
            var p = b.GetPoint3D();

            lock (this._sentBlocks)
            {
                if (!this.ShouldSend(b, p))
                {
                    e.Cancelled = true;

                    this.UpdateFinish();
                }
            }
        }
예제 #3
0
        internal bool SendMessage(T msg, IConnection connection)
        {
            var e = new SendingEventArgs <T>(msg);

            this.OnSending(e);
            if (!e.Cancelled)
            {
                var e2 = new SendEventArgs <T>(msg);
                this.OnSend(e2);

                e.Message.Send(connection);

                return(true);
            }
            return(false);
        }