private static SCPropertyAccessorBase GetPropertyAccessor(string funcName, AUConditionCalculatingContext context) { SCPropertyAccessorBase result = null; SchemaNameAndPropertyName snpn = SchemaNameAndPropertyName.FromFullName(funcName); snpn.CheckIsValid(); if (context.PropertyAccessors.TryGetValue(snpn, out result) == false) { result = new DefaultUsersPropertyAccessor(snpn); context.PropertyAccessors.Add(snpn, result); } return(result); }
private static object CalculateObjectFunction(string funcName, ParamObjectCollection arrParams, object callerContext) { AUConditionCalculatingContext context = (AUConditionCalculatingContext)callerContext; object result = null; if (SCBuiltInFunctionsCalculator.Instance.IsFunction(funcName)) { //如果是内置函数,则返回内置函数的结果 result = SCBuiltInFunctionsCalculator.Instance.Calculate(funcName, arrParams, context); } else { //根据函数名称,获取属性访问器 SCPropertyAccessorBase accessor = GetPropertyAccessor(funcName, context); result = accessor.GetValue(context, arrParams); } return(result); }
private static SCPropertyAccessorBase GetPropertyAccessor(string funcName, AUConditionCalculatingContext context) { SCPropertyAccessorBase result = null; SchemaNameAndPropertyName snpn = SchemaNameAndPropertyName.FromFullName(funcName); snpn.CheckIsValid(); if (context.PropertyAccessors.TryGetValue(snpn, out result) == false) { result = new DefaultUsersPropertyAccessor(snpn); context.PropertyAccessors.Add(snpn, result); } return result; }
public AUConditionCalculator(string schemaType) { schemaType.NullCheck("schemaType"); this._Context = new AUConditionCalculatingContext(schemaType); }