Example #1
0
        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);
        }
Example #2
0
        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;
		}
Example #4
0
 public AUConditionCalculator(string schemaType)
 {
     schemaType.NullCheck("schemaType");
     this._Context = new AUConditionCalculatingContext(schemaType);
 }
		public AUConditionCalculator(string schemaType)
		{
			schemaType.NullCheck("schemaType");
			this._Context = new AUConditionCalculatingContext(schemaType);
		}