-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathFormAttributes.cs
42 lines (41 loc) · 1.25 KB
/
FormAttributes.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace SurveyJSAsFormLibrary.Attributes
{
[System.AttributeUsage(AttributeTargets.Class, Inherited = false)]
sealed class DomainModelFormAttribute : Attribute
{
private string name;
private string title;
public DomainModelFormAttribute(string name, string title = "")
{
this.name = name;
this.title = title;
}
public string Name { get { return name; } }
public string Title { get { return title; } }
}
[System.AttributeUsage(AttributeTargets.Property, Inherited = false)]
sealed class FormPageAttribute : Attribute
{
public FormPageAttribute()
{
}
public string Title { get; set; }
}
[System.AttributeUsage(AttributeTargets.Property, Inherited = false)]
sealed class FormFieldAttribute : Attribute
{
public FormFieldAttribute()
{
}
public string FieldType { get; set; }
public string InputType { get; set; }
public string ChoicesByUrl { get; set; }
public string[] Choices { get; set; }
}
}