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

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

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

            if (IsDestinationInfoEmpty(notifierConfig))
            {
                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(BotConfiguration.Notifier notifierConfig)
 {
     return(string.IsNullOrEmpty(notifierConfig.UserProfileField) &&
            (notifierConfig.FixedRecipients == null || notifierConfig.FixedRecipients.Length == 0));
 }