예제 #1
0
            /// <summary>
            /// Handles an unsolicited message from the connected client.
            /// </summary>
            internal void OnMessage(AirDropHubMessage message)
            {
                switch (message)
                {
                case ConnectMessage connectMessage:
                    Name = connectMessage.Name;
                    break;

                default:
                    _logger.LogWarning("Unable to handle message of type {MessageType}", message.GetType());
                    break;
                }
            }
예제 #2
0
 public void Deconstruct(out AirDropHubMessage message, out CallbackValueTaskSource?callback)
 {
     message  = Message;
     callback = Callback;
 }
예제 #3
0
 public MessageWithCallback(AirDropHubMessage message, CallbackValueTaskSource?callback)
 {
     Message  = message ?? throw new ArgumentNullException(nameof(message));
     Callback = callback;
 }