public ValidationKey GenerateKey(KeyScope keyscope, long forumuserid, ulong userid, ulong guildid) { ValidationKey key; while (ValidationKeys.Contains(key = new ValidationKey(InternalGenerateKey(), keyscope, forumuserid, userid, guildid))) { } Task.Run(async() => { await Task.Delay(600000); ValidationKeys.TryRemove(key); }); ValidationKeys.Add(key); return(key); }
public static string GetValidationMessage(ValidationKey key, IEnumerable <string> parameterList) => instance.validationMessage.GetMessage(key.ToString(), parameterList);
public static string GetValidationMessage(ValidationKey key, string parameter) => instance.validationMessage.GetMessage(key.ToString(), parameter);
public static string GetValidationMessage(ValidationKey key) => instance.validationMessage.GetMessage(key.ToString());
protected bool Equals(ValidationKey other) { return(string.Equals(Key, other.Key) && KeyScope == other.KeyScope && ForumUserId == other.ForumUserId && DiscordUserId == other.DiscordUserId && GuildId == other.GuildId && CreatedAt == other.CreatedAt); }
public static void AddError(this ValidationResult valid, ValidationKey key, IEnumerable <string> parameterList) { AddError(valid, key.ToString(), () => MessageOperation.GetValidationMessage(key, parameterList)); }
public static void AddError(this ValidationResult valid, ValidationKey key, string parameter = null) { AddError(valid, key.ToString(), () => MessageOperation.GetValidationMessage(key, parameter)); }