protected void Page_Init(object sender, EventArgs e)
 {
     if (CriteriaOperator.GetCustomFunction("MyNewFunction") == null)
     {
         CriteriaOperator.RegisterCustomFunction(new MyFunction());
     }
 }
 protected void Page_Init(object sender, EventArgs e)
 {
     if (CriteriaOperator.GetCustomFunction(EasySearchStatic.Name) == null)
     {
         CriteriaOperator.RegisterCustomFunction(new EasySearchString());
     }
 }
Ejemplo n.º 3
0
        public Vinabits_OM_2017Module()
        {
            InitializeComponent();
            BaseObject.OidInitializationMode = OidInitializationMode.AfterConstruction;

            CurrentEmployeeOidOperator.Register();
            CurrentEmployeeUserNameOperator.Register();
            CurrentEmployeeOperator.Register();
            CurrentEmployeeIsRootOperator.Register();
            CurrentDepartmentOidOperator.Register();
            if (CriteriaOperator.GetCustomFunction(CheckIsReadOperator.OperatorName) == null)
            {
                CriteriaOperator.RegisterCustomFunction(new CheckIsReadOperator());
            }

            if (CriteriaOperator.GetCustomFunction(DocumentCheckIsReadOperator.OperatorName) == null)
            {
                CriteriaOperator.RegisterCustomFunction(new DocumentCheckIsReadOperator());
            }

            if (CriteriaOperator.GetCustomFunction(DocumentCheckIsFollowOperator.OperatorName) == null)
            {
                CriteriaOperator.RegisterCustomFunction(new DocumentCheckIsFollowOperator());
            }
        }
Ejemplo n.º 4
0
 static csCSecurityUserDepartment()
 {
     if (CriteriaOperator.GetCustomFunction(Name) == null)
     {
         CriteriaOperator.RegisterCustomFunction(new csCSecurityUserDepartment());
     }
 }
Ejemplo n.º 5
0
 static crmCPartyUserPartyCurrent()
 {
     if (CriteriaOperator.GetCustomFunction(Name) == null)
     {
         CriteriaOperator.RegisterCustomFunction(new crmCPartyUserPartyCurrent());
     }
 }
Ejemplo n.º 6
0
 protected void Page_Init(object sender, EventArgs e)
 {
     if (CriteriaOperator.GetCustomFunction(AccentInsensitiveFilterStatic.Name) == null)
     {
         CriteriaOperator.RegisterCustomFunction(new AccentInsensitiveFilterOperator());
     }
     XpoDataSource1.Session = XpoHelper.GetNewSession();
 }
Ejemplo n.º 7
0
        static CurrentShipperDCOperator()
        {
            CurrentShipperDCOperator instance = new CurrentShipperDCOperator();

            if (CriteriaOperator.GetCustomFunction(instance.Name) == null)
            {
                CriteriaOperator.RegisterCustomFunction(instance);
            }
        }
        static IsNumberValueFunctionOperator()
        {
            IsNumberValueFunctionOperator instance = new IsNumberValueFunctionOperator();

            if (CriteriaOperator.GetCustomFunction(instance.Name) == null)
            {
                CriteriaOperator.RegisterCustomFunction(instance);
            }
        }
Ejemplo n.º 9
0
        static CurrentEmployeeIsRootOperator()
        {
            CurrentEmployeeIsRootOperator instance = new CurrentEmployeeIsRootOperator();

            if (CriteriaOperator.GetCustomFunction(instance.Name) == null)
            {
                CriteriaOperator.RegisterCustomFunction(instance);
            }
        }
        static ValidateExtNumOperator()
        {
            ValidateExtNumOperator instance = new ValidateExtNumOperator();

            if (CriteriaOperator.GetCustomFunction(instance.Name) == null)
            {
                CriteriaOperator.RegisterCustomFunction(instance);
            }
        }
Ejemplo n.º 11
0
        public static void Register(this ICustomFunctionOperator customFunctionOperator)
        {
            ICustomFunctionOperator registeredItem = CriteriaOperator.GetCustomFunction(customFunctionOperator.Name);

            if (registeredItem != null && registeredItem != customFunctionOperator && !(XafTypesInfo.Instance is TypesInfoBuilder.TypesInfo) && InterfaceBuilder.RuntimeMode)
            {
                throw new InvalidOperationException();
            }
            if (registeredItem == null)
            {
                CriteriaOperator.RegisterCustomFunction(customFunctionOperator);
            }
        }
Ejemplo n.º 12
0
        public static void Register(this ICustomFunctionOperator customFunctionOperator)
        {
            ICustomFunctionOperator registeredItem = CriteriaOperator.GetCustomFunction(customFunctionOperator.Name);

            if (registeredItem != null && registeredItem != customFunctionOperator)
            {
                throw new InvalidOperationException();
            }
            if (registeredItem == null)
            {
                CriteriaOperator.RegisterCustomFunction(customFunctionOperator);
            }
        }
Ejemplo n.º 13
0
 object ICriteriaVisitor <object> .Visit(FunctionOperator theOperator)
 {
     Process(theOperator);
     if (theOperator.OperatorType == FunctionOperatorType.Custom)
     {
         var customFunctionOperator = CriteriaOperator.GetCustomFunction(((OperandValue)theOperator.Operands.First()).Value.ToString());
         if (customFunctionOperator != null)
         {
             var parameters = theOperator.Operands.OfType <OperandValue>().Skip(1).Select(operand => operand.Value);
             return(customFunctionOperator.Evaluate(parameters));
         }
     }
     return(theOperator);
 }
        private static FunctionOperatorType GetOperatorTypeByMethodName(string methodName)
        {
            FunctionOperatorType result = FunctionOperatorType.Custom;

            if (CriteriaOperator.GetCustomFunction(methodName) != null)
            {
                return(result);
            }
            if (Enum.TryParse <FunctionOperatorType>(methodName, out result))
            {
                return(result);
            }
            string msg = string.Format(CultureInfo.CurrentCulture, Resources.MethodNotSupportedException, methodName);

            throw new NotSupportedException(msg);
        }
Ejemplo n.º 15
0
 public static void Register(this ICustomFunctionOperator customFunctionOperator)
 {
     if (!(XafTypesInfo.Instance is TypesInfoBuilder.TypesInfo))
     {
         ICustomFunctionOperator registeredItem = CriteriaOperator.GetCustomFunction(customFunctionOperator.Name);
         if (registeredItem != null && registeredItem != customFunctionOperator && InterfaceBuilder.RuntimeMode)
         {
             if (CriteriaOperatorExtensions.ThirdPartyCustomFunctionOperators.All(op => op.Name != customFunctionOperator.Name))
             {
                 throw new InvalidOperationException();
             }
         }
         else if (registeredItem == null)
         {
             CriteriaOperator.RegisterCustomFunction(customFunctionOperator);
         }
     }
 }