protected virtual void OnSending(SendingEventArgs <T> e) { var handler = this.Sending; if (handler != null) { handler(this, e); } }
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(); } } }
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); }