public ServerSetChatModeStatusPayload(ChatModeType publicChatMode, ChatModeType privateChatMode, ChatModeType tradeChatMode)
        {
            if (!Enum.IsDefined(typeof(ChatModeType), publicChatMode))
            {
                throw new InvalidEnumArgumentException(nameof(publicChatMode), (int)publicChatMode, typeof(ChatModeType));
            }
            if (!Enum.IsDefined(typeof(ChatModeType), privateChatMode))
            {
                throw new InvalidEnumArgumentException(nameof(privateChatMode), (int)privateChatMode, typeof(ChatModeType));
            }
            if (!Enum.IsDefined(typeof(ChatModeType), tradeChatMode))
            {
                throw new InvalidEnumArgumentException(nameof(tradeChatMode), (int)tradeChatMode, typeof(ChatModeType));
            }

            PublicChatMode  = publicChatMode;
            PrivateChatMode = privateChatMode;
            TradeChatMode   = tradeChatMode;
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Indicates if the mode is enabled such as:
 /// On or Friends Only.
 /// </summary>
 /// <param name="mode">The mode to check.</param>
 /// <returns></returns>
 public static bool isEnabled(this ChatModeType mode)
 {
     return(mode < ChatModeType.Off);
 }