Example #1
0
 public bool IsValid(object value, object arguments)
 {
     double[] doubleArray = CellBaseUtils.ToDoubleArray(arguments);
     if (value == null)
     {
         return(true);
     }
     return(Convert.ToDouble(value) >= doubleArray[0] && Convert.ToDouble(value) <= doubleArray[1]);
 }
 public static Dictionary <string, object> GetAttribtues(
     string classList,
     Dictionary <string, object> dictionary)
 {
     if (!dictionary.TryAdd("class", (object)classList))
     {
         dictionary["class"] = (object)CellBaseUtils.AddClass(classList, dictionary["class"].ToString());
     }
     return(dictionary);
 }
Example #3
0
        public bool IsValid(object value, object arguments)
        {
            int num = value == null ? 0 : ((string)value).Length;

            double[] doubleArray = CellBaseUtils.ToDoubleArray(arguments);
            if (value == null)
            {
                return(true);
            }
            return(Convert.ToDouble(num) >= doubleArray[0] && Convert.ToDouble(num) <= doubleArray[1]);
        }
        public static async Task <T> UpdateProperty <T>(
            T publicValue,
            T privateValue,
            EventCallback <T> eventCallback,
            EditContext editContext           = null,
            Expression <Func <T> > expression = null)
        {
            T finalValue = publicValue;

            if (eventCallback.HasDelegate && !CellBaseUtils.Equals <T>(publicValue, privateValue))
            {
                await eventCallback.InvokeAsync(finalValue);

                if (editContext != null)
                {
                    CellBaseUtils.ValidateExpression <T>(editContext, expression);
                }
            }
            T obj = finalValue;

            finalValue = default(T);
            return(obj);
        }