コード例 #1
0
        static bool CheckValidNotifierFields(
            TrunkBotConfiguration.Notifier botConfig,
            out string errorMessage)
        {
            errorMessage = string.Empty;

            if (botConfig == null)
            {
                return(true);
            }

            if (string.IsNullOrEmpty(botConfig.Plug))
            {
                errorMessage += BuildFieldError("plug name for Notifications config");
            }

            if (IsDestinationInfoEmpty(botConfig))
            {
                errorMessage += "* There is no destination info in the Notifications" +
                                " config. Please specify a user profile field, a list of recipients" +
                                " or both (recommended).\n";
            }

            return(string.IsNullOrEmpty(errorMessage));
        }
コード例 #2
0
 static bool IsDestinationInfoEmpty(TrunkBotConfiguration.Notifier botConfig)
 {
     return(string.IsNullOrEmpty(botConfig.UserProfileField) &&
            (botConfig.FixedRecipients == null || botConfig.FixedRecipients.Length == 0));
 }