123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace DymWebForm.Aspx
- {
- //meta
- [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
- public sealed class DWFMetaAttribute : Attribute
- {
- public Type Type { get; private set; }
- public DWFMetaAttribute(Type type)
- {
- Type = type;
- }
- }
- //db
- [AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = false)]
- public sealed class DWFIgnoreAttribute : Attribute
- {
- }
- [AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = false)]
- public sealed class DWFPKAttribute : Attribute
- {
- }
- [AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = false)]
- public sealed class DWFAllowNullAttribute : Attribute
- {
- }
- [AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = false)]
- public sealed class DWFFKDisplayAttribute : Attribute
- {
- }
- [AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = false)]
- public sealed class DWFFKAttribute : Attribute
- {
- public Type ParentType
- {
- get;
- private set;
- }
- public DWFFKAttribute(Type parentType)
- {
- this.ParentType = parentType;
- }
- }
- //form uis
- [AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = false)]
- public sealed class DWFDisplayOrderAttribute : Attribute
- {
- public int DisplayOrder
- {
- get;
- private set;
- }
- public DWFDisplayOrderAttribute(int displayOrder)
- {
- this.DisplayOrder = displayOrder;
- }
- }
- //defalut values
- [AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = false)]
- public abstract class DWFDefaultValueGeneratorAttribute : Attribute
- {
- public abstract object GenerateValue();
- }
- [AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = false)]
- public class DWFDefaultValueDateTimeNowAttribute : DWFDefaultValueGeneratorAttribute
- {
- public override object GenerateValue()
- {
- return DateTime.Now;
- }
- }
- [AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = false)]
- public class DWFDefaultValueBoolAttribute : DWFDefaultValueGeneratorAttribute
- {
- private bool m_value;
- public override object GenerateValue()
- {
- return m_value;
- }
- public DWFDefaultValueBoolAttribute(bool value)
- {
- m_value = value;
- }
- }
- //validations
- [AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = false)]
- public class DWFValidationTypeAttribute : Attribute
- {
- internal Type ValidationType { get; private set; }
- public DWFValidationTypeAttribute(Type validationType)
- {
- ValidationType = validationType;
- }
- }
- }
|