Exemplo n.º 1
0
        public IPropertyCustomizer OnUpdate(ValueBehavior behavior)
        {
            propertyCustomizerHolder.OnUpdateDefaultValue = behavior;
            propertyCustomizerHolder.IsCreatable          = false;

            return(this);
        }
Exemplo n.º 2
0
        public IPropertyCustomizer OnSave(ValueBehavior behavior)
        {
            OnCreate(behavior);
            OnUpdate(behavior);

            return this;
        }
Exemplo n.º 3
0
        public IPropertyCustomizer OnUpdate(ValueBehavior behavior)
        {
            propertyCustomizerHolder.OnUpdateDefaultValue = behavior;
            propertyCustomizerHolder.IsCreatable = false;

            return this;
        }
Exemplo n.º 4
0
        public IPropertyCustomizer OnSave(ValueBehavior behavior)
        {
            OnCreate(behavior);
            OnUpdate(behavior);

            return(this);
        }
Exemplo n.º 5
0
        private object GetBehaviorValue(ValueBehavior behavior)
        {
            switch (behavior)
            {
            case ValueBehavior.Now:
                return(DateTime.Now);

            case ValueBehavior.UtcNow:
                return(DateTime.UtcNow);

            case ValueBehavior.Guid:
                return(Guid.NewGuid());

            case ValueBehavior.CurrentUserId:
                return(0);

            case ValueBehavior.CurrentUserName:
            default:
                return("");
            }
        }
Exemplo n.º 6
0
 public OnSaveAttribute(ValueBehavior valueBehavior)
 {
     Value = valueBehavior;
 }
Exemplo n.º 7
0
 public static bool IsBehavior(this object val, ValueBehavior behavior)
 {
     return val is ValueBehavior && (ValueBehavior)val == behavior;
 }
Exemplo n.º 8
0
 public OnUpdateAttribute(ValueBehavior valueBehavior)
 {
     Value = valueBehavior;
 }
Exemplo n.º 9
0
 public static bool IsBehavior(this object val, ValueBehavior behavior)
 {
     return(val is ValueBehavior && (ValueBehavior)val == behavior);
 }
Exemplo n.º 10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DW.WPFToolkit.Controls.LostFocusBehavior" /> class.
 /// </summary>
 /// <param name="value">The behavior for the input value when null.</param>
 public LostFocusBehavior(ValueBehavior value)
 {
     Value           = value;
     TrimLeadingZero = false;
     FormatText      = null;
 }
Exemplo n.º 11
0
 /// <summary>
 /// Used only when soft delete for entity is enabled
 /// </summary>
 public OnDeleteAttribute(ValueBehavior valueBehavior)
 {
     Value = valueBehavior;
 }
Exemplo n.º 12
0
        public IPropertyCustomizer DefaultFilter(ValueBehavior behavior)
        {
            propertyCustomizerHolder.DefaultFilter = behavior;

            return(this);
        }
Exemplo n.º 13
0
        public IPropertyCustomizer OnDelete(ValueBehavior behavior)
        {
            propertyCustomizerHolder.OnDeleteDefaultValue = behavior;

            return this;
        }
Exemplo n.º 14
0
        public IPropertyCustomizer DefaultFilter(ValueBehavior behavior)
        {
            propertyCustomizerHolder.DefaultFilter = behavior;

            return this;
        }
Exemplo n.º 15
0
 public DefaultFilterAttribute(ValueBehavior valueBehavior)
 {
     Value = valueBehavior;
 }
Exemplo n.º 16
0
 /// <summary>
 /// Used only when soft delete for entity is enabled
 /// </summary>
 public OnDeleteAttribute(ValueBehavior valueBehavior)
 {
     Value = valueBehavior;
 }
Exemplo n.º 17
0
        public IPropertyCustomizer OnDelete(ValueBehavior behavior)
        {
            propertyCustomizerHolder.OnDeleteDefaultValue = behavior;

            return(this);
        }
Exemplo n.º 18
0
 public OnCreateAttribute(ValueBehavior valueBehavior)
 {
     Value = valueBehavior;
 }
Exemplo n.º 19
0
 public OnSaveAttribute(ValueBehavior valueBehavior)
 {
     Value = valueBehavior;
 }