示例#1
0
 protected static string?GetRawMessage(SlackSocketMessage message)
 {
     // ReSharper disable once SuspiciousTypeConversion.Global
     if (message is not IRawMessage rawMessage)
     {
         throw new InvalidCastException($"'{message.GetType().FullName}' is not a proxy class and cannot be casted to IRawMessage");
     }
示例#2
0
        private string GetRawMessage(SlackSocketMessage message)
        {
            IRawMessage rawMessage = message as IRawMessage;

            if (rawMessage == null)
            {
                throw new InvalidCastException($"'{message.GetType().FullName}' is not a proxy class and cannot be casted to IRawMessage");
            }
            else
            {
                return(rawMessage.Data);
            }
        }
 private string GetRawMessage(SlackSocketMessage message)
 {
     IRawMessage rawMessage = message as IRawMessage;
       if (rawMessage == null)
       {
     throw new InvalidCastException($"'{message.GetType().FullName}' is not a proxy class and cannot be casted to IRawMessage");
       }
       else
       {
     return rawMessage.Data;
       }
 }