示例#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);
        }