Пример #1
0
        public virtual OnSetOutputModel OnSet(OnSetInputModel input)
        {
            var model = new OnSetOutputModel();

            model.DepartmentStore.SetPropertyValue(OnSetOutputModel.IsChangePropertyValueProperty, false);

            return(model);
        }
Пример #2
0
        public override OnSetOutputModel OnSet(OnSetInputModel input)
        {
            if (isGettedAcsees.Contains(input.DepartmentStore.GetPropertyValue(OnSetInputModel.ValueStoreProperty)))
            {
                return(support.OnSet(input));
            }

            isGettedAcsees.Add(input.DepartmentStore.GetPropertyValue(OnSetInputModel.ValueStoreProperty));
            return(base.OnSet(input));
        }
        public override OnSetOutputModel OnSet(OnSetInputModel input)
        {
            redirectMethod.Invoke(input.DepartmentStore.GetPropertyValue(OnSetInputModel.PropertySettableValueProperty));

            var model = base.OnSet(input);

            model.DepartmentStore.SetPropertyValue(OnSetOutputModel.IsChangePropertyValueProperty, true);
            model.DepartmentStore.SetPropertyValue(OnSetOutputModel.NewPropertyValueProperty,
                                                   input.DepartmentStore.GetPropertyValue(OnSetInputModel.ValueStoreProperty).GetPropertyValue(input.DepartmentStore.GetPropertyValue(OnSetInputModel.PropertyInfoProperty)));
            return(model);
        }
 public override OnSetOutputModel OnSet(OnSetInputModel input)
 {
     if (input.DepartmentStore.GetPropertyValue(OnSetInputModel.HasValidTokenProperty) == false)
     {
         throw new MemberAccessException("You need to have the VALID DepartmentPropertiesValuesStoreControlToken to acsees to set method of this property");
     }
     else
     {
         return(base.OnSet(input));
     }
 }
Пример #5
0
        public override OnSetOutputModel OnSet(OnSetInputModel input)
        {
            decimal current = ((IConvertible)input.DepartmentStore.GetPropertyValue(OnSetInputModel.PropertySettableValueProperty) ?? 0).ToDecimal(new NumberFormatInfo());
            decimal newVal  = Math.Max(Math.Min(current, max), min);

            OnSetOutputModel model = base.OnSet(input);

            model.DepartmentStore.SetPropertyValue(OnSetOutputModel.IsChangePropertyValueProperty, true);
            model.DepartmentStore.SetPropertyValue(OnSetOutputModel.NewPropertyValueProperty,
                                                   ((IConvertible)newVal).ToType(input.DepartmentStore.GetPropertyValue(OnSetInputModel.PropertyInfoProperty).PropertyType, new NumberFormatInfo()));


            return(model);
        }
Пример #6
0
        public override OnSetOutputModel OnSet(OnSetInputModel input)
        {
            if (predicate.Invoke(input.DepartmentStore.GetPropertyValue(OnSetInputModel.PropertySettableValueProperty)) == false)
            {
                var model = base.OnSet(input);
                model.DepartmentStore.SetPropertyValue(OnSetOutputModel.IsChangePropertyValueProperty, true);
                model.DepartmentStore.SetPropertyValue(OnSetOutputModel.NewPropertyValueProperty,
                                                       input.DepartmentStore.GetPropertyValue(OnSetInputModel.ValueStoreProperty).GetPropertyValue(input.DepartmentStore.GetPropertyValue(OnSetInputModel.PropertyInfoProperty)));

                return(model);
            }
            else
            {
                return(base.OnSet(input));
            }
        }