public void ChatEvent(AsyncDuplexStreamingCall <Message, Message> chat) { var response = chat.ResponseStream.Current; ChatEventArgs args = new ChatEventArgs { Date = DateTime.Now, Username = response.User, }; OnMessageRecieved(args); }
protected virtual void OnMessageRecieved(ChatEventArgs c) { MessageGot?.Invoke(this, c); }
static void IMessageGot(object sender, ChatEventArgs cea) { Console.WriteLine($"{cea.Username} at {cea.Date}"); }