Example #1
0
        public IPropertyCustomizer OnUpdate(ValueBehavior behavior)
        {
            propertyCustomizerHolder.OnUpdateDefaultValue = behavior;
            propertyCustomizerHolder.IsCreatable          = false;

            return(this);
        }
Example #2
0
        public IPropertyCustomizer OnSave(ValueBehavior behavior)
        {
            OnCreate(behavior);
            OnUpdate(behavior);

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

            return this;
        }
Example #4
0
        public IPropertyCustomizer OnSave(ValueBehavior behavior)
        {
            OnCreate(behavior);
            OnUpdate(behavior);

            return(this);
        }
Example #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("");
            }
        }
Example #6
0
 public OnSaveAttribute(ValueBehavior valueBehavior)
 {
     Value = valueBehavior;
 }
 public static bool IsBehavior(this object val, ValueBehavior behavior)
 {
     return val is ValueBehavior && (ValueBehavior)val == behavior;
 }
Example #8
0
 public OnUpdateAttribute(ValueBehavior valueBehavior)
 {
     Value = valueBehavior;
 }
 public static bool IsBehavior(this object val, ValueBehavior behavior)
 {
     return(val is ValueBehavior && (ValueBehavior)val == behavior);
 }
Example #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;
 }
Example #11
0
 /// <summary>
 /// Used only when soft delete for entity is enabled
 /// </summary>
 public OnDeleteAttribute(ValueBehavior valueBehavior)
 {
     Value = valueBehavior;
 }
Example #12
0
        public IPropertyCustomizer DefaultFilter(ValueBehavior behavior)
        {
            propertyCustomizerHolder.DefaultFilter = behavior;

            return(this);
        }
Example #13
0
        public IPropertyCustomizer OnDelete(ValueBehavior behavior)
        {
            propertyCustomizerHolder.OnDeleteDefaultValue = behavior;

            return this;
        }
Example #14
0
        public IPropertyCustomizer DefaultFilter(ValueBehavior behavior)
        {
            propertyCustomizerHolder.DefaultFilter = behavior;

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

            return(this);
        }
Example #18
0
 public OnCreateAttribute(ValueBehavior valueBehavior)
 {
     Value = valueBehavior;
 }
Example #19
0
 public OnSaveAttribute(ValueBehavior valueBehavior)
 {
     Value = valueBehavior;
 }