public static bool CheckValidNotifierFields( MultilinerBotConfiguration.Notifier notifier, out string errorMessage) { errorMessage = string.Empty; if (notifier == null) { return(true); } if (string.IsNullOrEmpty(notifier.Plug)) { errorMessage += BuildFieldError(string.Format( "plug name for Notifier '{0}' config", notifier.Name)); } if (IsDestinationInfoEmpty(notifier)) { errorMessage += string.Format("* There is no destination info in the Notifier '{0}'" + " config. Please specify a user profile field, a list of recipients" + " or both (recommended).\n", notifier.Name); } return(string.IsNullOrEmpty(errorMessage)); }
static bool IsDestinationInfoEmpty(MultilinerBotConfiguration.Notifier botConfig) { return(string.IsNullOrEmpty(botConfig.UserProfileField) && (botConfig.FixedRecipients == null || botConfig.FixedRecipients.Length == 0)); }