Exemplo n.º 1
0
 static csCSecurityUserDepartment()
 {
     if (CriteriaOperator.GetCustomFunction(Name) == null)
     {
         CriteriaOperator.RegisterCustomFunction(new csCSecurityUserDepartment());
     }
 }
        private ExcelStyleFilterElementOperatorItem CreateLastYearsOperator()
        {
            const string CustomFunctionName = "LastYears";
            var          currentYear        = DateTime.Now.Year;
            ICustomFunctionOperatorBrowsable customFunction = CustomFunctionFactory.Create(CustomFunctionName,
                                                                                           (DateTime date, int threshold) =>
            {
                return(currentYear >= date.Year && currentYear - date.Year <= threshold);
            }
                                                                                           );

            CriteriaOperator.RegisterCustomFunction(customFunction);
            var customFunctionEditSettings = new BaseEditSettings[] {
                new TextEditSettings {
                    MaskType = MaskType.Numeric,
                    Mask     = "D",
                    MaskUseAsDisplayFormat = true,
                    NullText = "Enter the number of years before..."
                }
            };

            return(new ExcelStyleFilterElementOperatorItem(CustomFunctionName, customFunctionEditSettings)
            {
                Caption = "Last Years"
            });
        }
Exemplo n.º 3
0
 static crmCPartyUserPartyCurrent()
 {
     if (CriteriaOperator.GetCustomFunction(Name) == null)
     {
         CriteriaOperator.RegisterCustomFunction(new crmCPartyUserPartyCurrent());
     }
 }
Exemplo n.º 4
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());
            }
        }
 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());
     }
 }
Exemplo n.º 7
0
 public RX2_OfficeModule()
 {
     InitializeComponent();
     BaseObject.OidInitializationMode = OidInitializationMode.AfterConstruction;
     CriteriaOperator.RegisterCustomFunction(new CurrentUserNameOperator());
     CriteriaOperator.RegisterCustomFunction(new CurrentShipperDCOperator());
 }
Exemplo n.º 8
0
 public static void RegisterCustomFunctions()
 {
     CriteriaOperator.RegisterCustomFunction(new CashDiscipline.Module.CustomFunctions.MultiConcatFunction());
     CriteriaOperator.RegisterCustomFunction(new CashDiscipline.Module.CustomFunctions.RegexMatchFunction());
     CriteriaOperator.RegisterCustomFunction(new CashDiscipline.Module.CustomFunctions.BoMonthFunction());
     CriteriaOperator.RegisterCustomFunction(new CashDiscipline.Module.CustomFunctions.EoMonthFunction());
 }
Exemplo n.º 9
0
 static ApplicationNameOperator()
 {
     if (!registered)
     {
         CriteriaOperator.RegisterCustomFunction(new ApplicationNameOperator());
         registered = true;
     }
 }
Exemplo n.º 10
0
 protected void Page_Init(object sender, EventArgs e)
 {
     CriteriaOperator.RegisterCustomFunction(new RemoveDiacriticsFunction());
     if (!IsPostBack)
     {
         Grid.FilterExpression = "Contains([ProductName], 'Ros')";
     }
 }
Exemplo n.º 11
0
 static CurrentNodeIdOperator()
 {
     if (!registered)
     {
         CriteriaOperator.RegisterCustomFunction(new CurrentNodeIdOperator());
         registered = true;
     }
 }
Exemplo n.º 12
0
 protected void Page_Init(object sender, EventArgs e)
 {
     if (CriteriaOperator.GetCustomFunction(AccentInsensitiveFilterStatic.Name) == null)
     {
         CriteriaOperator.RegisterCustomFunction(new AccentInsensitiveFilterOperator());
     }
     XpoDataSource1.Session = XpoHelper.GetNewSession();
 }
Exemplo n.º 13
0
 static SnapshotNodeIdOperator()
 {
     if (!registered)
     {
         CriteriaOperator.RegisterCustomFunction(new SnapshotNodeIdOperator());
         registered = true;
     }
 }
Exemplo n.º 14
0
        static CurrentEmployeeIsRootOperator()
        {
            CurrentEmployeeIsRootOperator instance = new CurrentEmployeeIsRootOperator();

            if (CriteriaOperator.GetCustomFunction(instance.Name) == null)
            {
                CriteriaOperator.RegisterCustomFunction(instance);
            }
        }
Exemplo n.º 15
0
        static CurrentShipperDCOperator()
        {
            CurrentShipperDCOperator instance = new CurrentShipperDCOperator();

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

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

            if (CriteriaOperator.GetCustomFunction(instance.Name) == null)
            {
                CriteriaOperator.RegisterCustomFunction(instance);
            }
        }
 static void Main()
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     BonusSkins.Register();
     SkinManager.EnableFormSkins();
     UserLookAndFeel.Default.SkinName = "Lilian";
     CriteriaOperator.RegisterCustomFunction(new RemoveDiacriticsFunction());
     Application.Run(new MainForm());
 }
Exemplo n.º 19
0
        public override void Setup(XafApplication application)
        {
            base.Setup(application);

            application.SetupComplete += application_SetupComplete;
            application.CreateCustomLogonWindowObjectSpace += (sender, args) => { args.ObjectSpace = (( CoreAppLogonParameters )args.LogonParameters).ObjectSpace = application.CreateObjectSpace( ); };

            if (CriteriaOperator.GetCustomFunctions( ).GetCustomFunction("ConvertToStr") == null)
            {
                CriteriaOperator.RegisterCustomFunction(new ConvertToStrFunction( ));
            }
        }
Exemplo n.º 20
0
        public ApplicationRibbonFormBase()
        {
            DevExpress.Data.Linq.CriteriaToEFExpressionConverter.EntityFunctionsType = typeof(System.Data.Entity.DbFunctions);
            DevExpress.Data.Linq.CriteriaToEFExpressionConverter.SqlFunctionsType    = typeof(System.Data.Entity.SqlServer.SqlFunctions);
            CriteriaOperator.RegisterCustomFunction(new xwcs.core.linq.LikeFunction());



            InitializeComponent();

            /*
             * Assembly locating
             */

            if (!DesignMode)
            {
                documentManager.View.DocumentProperties.UseFormIconAsDocumentImage = true;
                documentManager.View.UseDocumentSelector = DevExpress.Utils.DefaultBoolean.True;
                tabbedView.FloatingDocumentContainer     = FloatingDocumentContainer.DocumentsHost;

                // Security context must be call first time in main app and
                // must have providers set
                _user = SecurityContext.getInstance().CurrentUser;

                _proxy = SEventProxy.getInstance();
                _proxy.addEventHandler <AddToolBarRequestEvent>(EventType.AddToolBarRequestEvent, HandleAddToolbarRequestEvent);
                _proxy.addEventHandler <OpenPanelRequestEvent>(EventType.OpenPanelRequestEvent, HandleOpenPanelRequestEvent);
                _proxy.addEventHandler <VisualControlActionEvent>(EventType.VisualControlActionEvent, HandleVisualControlAction);
                _proxy.addEventHandler <ClosePanelRequestEvent>(EventType.ClosePanelRequestEvent, HandleClosePanelRequestEvent);

                // invocation target for events
                SEventProxy.InvokeDelegate = this;

                //do it here before any other plugin will be loaded!!!!!
                _widgetManager = SWidgetManager.getInstance();

                //now we can load plugins
                _loader = SPluginsLoader.getInstance();
                _loader.LoadPlugins(this, ".");

                controls.ViewBaseEventsHandler.AttachToView(documentManager.View);

                _managerSupport = new DocumentManagerSupport(documentManager,
                                                             new DevExpress.XtraBars.BarItem[] { barButtonItem_FileSave },
                                                             new DevExpress.XtraBars.BarItem[] { barButtonItem_FileSaveAll });
                ribbonControl.SelectedPage = ribbonPagePlugins;


                // some form function tweaks
                // AutoValidate = AutoValidate.EnableAllowFocusChange;
                this.FormClosing += ApplicationRibbonFormBase_FormClosing;
            }
        }
Exemplo n.º 21
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);
            }
        }
Exemplo n.º 22
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);
            }
        }
Exemplo n.º 23
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);
         }
     }
 }
Exemplo n.º 24
0
        static void Main()
        {
            SkinManager.EnableFormSkins();
            BonusSkins.Register();
            DevExpress.Utils.AppearanceObject.DefaultFont = new System.Drawing.Font("????", 8.5f);

            Thread.CurrentThread.CurrentCulture   = CultureManager.CurrentCulture;
            Thread.CurrentThread.CurrentUICulture = CultureManager.CurrentCulture;

            CriteriaOperator.RegisterCustomFunction(new IsEarlierNextWeekFunction());
            CriteriaOperator.RegisterCustomFunction(new IsPriorDaysFunction());
            CriteriaOperator.RegisterCustomFunction(new IsDuringDaysFunction());
            CriteriaOperator.RegisterCustomFunction(new IsLastMonthFunction());
#if (DEBUG)
            RunInDebugMode();
#else
            RunInReleaseMode();
#endif
        }
Exemplo n.º 25
0
        /// <summary>
        /// Creates and registers the custom functions used to filter the category column which typically is of type <see cref="IEnumerable{Category}"/>
        /// </summary>
        private static void CreateAndRegisterCustomFunctionOperators()
        {
            var isMemberOfCategoryFunction = CustomFunctionFactory.Create(
                IsMemberOfCategoryName,
                (IEnumerable <Category> categories, string categoryName) =>
            {
                return(categories?.Any(x => x.Name.ToString().Equals(categoryName) || x.AllSuperCategories().Any(y => y.Name.ToString().Equals(categoryName))) ?? false);
            });

            CriteriaOperator.RegisterCustomFunction(isMemberOfCategoryFunction);

            var hasCategoryAppliedFunction = CustomFunctionFactory.Create(
                HasCategoryApplied,
                (IEnumerable <Category> categories, string categoryName) =>
            {
                return(categories?.Any(x => x.Name.ToString().Equals(categoryName)) ?? false);
            });

            CriteriaOperator.RegisterCustomFunction(hasCategoryAppliedFunction);
        }
Exemplo n.º 26
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            UnityConfig.RegisterComponents();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            WebHelper.Log = new LogService();

            ModelBinders.Binders.Add(typeof(decimal), new DecimalModelBinder());
            ModelBinders.Binders.Add(typeof(decimal?), new DecimalModelBinder());
            ModelBinders.Binders.Add(typeof(double), new DecimalModelBinder());
            ModelBinders.Binders.Add(typeof(double?), new DecimalModelBinder());
            CriteriaOperator.RegisterCustomFunction(new AccentFilter());
            //Data annotations
            DataAnnotationsModelValidatorProvider.RegisterAdapter(typeof(RequiredAttribute), typeof(CustomRequiredAttributeAdapter));
            DevExpress.XtraReports.Web.Extensions.ReportStorageWebExtension.RegisterExtensionGlobal(new CustomReportStorageWebExtension());
            ModelBinders.Binders.DefaultBinder = new DevExpress.Web.Mvc.DevExpressEditorsBinder();
        }
Exemplo n.º 27
0
        protected override void OnStartup(StartupEventArgs e)
        {
            CriteriaOperator.RegisterCustomFunction(new ToggleCaseFunction());
            CriteriaOperator.RegisterCustomFunction(new TitleCaseFunction());
            CriteriaOperator.RegisterCustomFunction(new SentenceCaseFunction());
            CriteriaOperator.RegisterCustomFunction(new RemoveInvalidFileNameCharactersFunction());
            CriteriaOperator.RegisterCustomFunction(new RegexMatchFunction());
            CriteriaOperator.RegisterCustomFunction(new RegexIsMatchFunction());
            CriteriaOperator.RegisterCustomFunction(new RegexConcatFunction());
            CriteriaOperator.RegisterCustomFunction(new RegexReplaceFunction());
            CriteriaOperator.RegisterCustomFunction(new StringFormatFunction());

            Repository           = new Repository("Data.db");
            TaskbarIconContainer = FindResource("TaskbarIconContainer") as UserControl;

            FileSystemWatcherHelper.Start();

            ParseArgumentsAndRun(e.Args);

            base.OnStartup(e);
        }
Exemplo n.º 28
0
        static void Main()
        {
#if EASYTEST
            DevExpress.ExpressApp.Win.EasyTest.EasyTestRemotingRegistration.Register();
#endif
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            EditModelPermission.AlwaysGranted = System.Diagnostics.Debugger.IsAttached;
            Tracing.LocalUserAppDataPath      = Application.LocalUserAppDataPath;
            Tracing.Initialize();
            CashDisciplineWindowsFormsApplication winApplication = new CashDisciplineWindowsFormsApplication();

            if (ConfigurationManager.ConnectionStrings["ConnectionString"] != null)
            {
                winApplication.ConnectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
            }
#if EASYTEST
            if (ConfigurationManager.ConnectionStrings["EasyTestConnectionString"] != null)
            {
                winApplication.ConnectionString = ConfigurationManager.ConnectionStrings["EasyTestConnectionString"].ConnectionString;
            }
#endif
            if (System.Diagnostics.Debugger.IsAttached && winApplication.CheckCompatibilityType == CheckCompatibilityType.DatabaseSchema)
            {
                winApplication.DatabaseUpdateMode = DatabaseUpdateMode.UpdateDatabaseAlways;
            }
            try {
                CriteriaOperator.RegisterCustomFunction(new CashDiscipline.Module.CustomFunctions.MultiConcatFunction());
                CriteriaOperator.RegisterCustomFunction(new CashDiscipline.Module.CustomFunctions.RegexMatchFunction());
                CriteriaOperator.RegisterCustomFunction(new CashDiscipline.Module.CustomFunctions.BoMonthFunction());
                CriteriaOperator.RegisterCustomFunction(new CashDiscipline.Module.CustomFunctions.EoMonthFunction());

                winApplication.Setup();
                winApplication.Start();
            }
            catch (Exception e)
            {
                winApplication.HandleException(e);
            }
        }
 public CustomFunctionContext(ICustomFunctionOperator customFunction)
 {
     CustomFunctionName = customFunction.Name;
     CriteriaOperator.RegisterCustomFunction(customFunction);
 }
Exemplo n.º 30
0
 public static void Register()
 {
     CriteriaOperator.RegisterCustomFunction(instance);
 }