mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 14:34:23 +01:00
Form System Flexibility improvements (#4774)
* Introduce very flexible form input system * Refactorings after rebase * Test fix * Update BTCPayServer/Forms/FormDataService.cs --------- Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
This commit is contained in:
@@ -9,12 +9,18 @@ public interface IFormComponentProvider
|
||||
string View { get; }
|
||||
void Validate(Form form, Field field);
|
||||
void Register(Dictionary<string, IFormComponentProvider> typeToComponentProvider);
|
||||
string GetValue(Form form, Field field);
|
||||
}
|
||||
|
||||
public abstract class FormComponentProviderBase : IFormComponentProvider
|
||||
{
|
||||
public abstract string View { get; }
|
||||
public abstract void Register(Dictionary<string, IFormComponentProvider> typeToComponentProvider);
|
||||
public virtual string GetValue(Form form, Field field)
|
||||
{
|
||||
return field.Value;
|
||||
}
|
||||
|
||||
public abstract void Validate(Form form, Field field);
|
||||
|
||||
public void ValidateField<T>(Field field) where T : ValidationAttribute, new()
|
||||
|
||||
Reference in New Issue
Block a user