示例#1
0
        public static void RegisterDefaults(this XafApplication application, params ModuleBase[] modules)
        {
            if (modules.Any() && application.Security is SecurityStrategyComplex)
            {
                modules = modules.Add(new TestApplicationModule()).ToArray();
            }

            application.AlwaysUpdateOnDatabaseVersionMismatch().Subscribe();
            var moduleBases = new[] {
                new SystemModule(),
                application is WinApplication ? (ModuleBase) new SystemWindowsFormsModule() : new SystemAspNetModule()
            }.Concat(modules.Concat(new [] { new ReactiveLoggerModule() }));

            if (((ITestApplication)application).TransmitMessage)
            {
                if (Process.GetProcessesByName("Xpand.XAF.Modules.Reactive.Logger.Client.Win").Any())
                {
                    moduleBases = moduleBases.Add(new ReactiveLoggerHubModule());
                }
            }

            foreach (var moduleBase in moduleBases)
            {
                if (application.Modules.All(_ => moduleBase.GetType() != _.GetType()))
                {
                    application.Modules.Add(moduleBase);
                }
            }

            application.AddObjectSpaceProvider();
        }
示例#2
0
 public static void RegisterDefaults(this XafApplication application, params ModuleBase[] modules)
 {
     application.AlwaysUpdateOnDatabaseVersionMismatch().Subscribe();
     application.Modules.Add((ReactiveModule)typeof(ReactiveModule).CreateInstance());
     application.Modules.AddRange(modules);
     application.RegisterInMemoryObjectSpaceProvider();
 }
示例#3
0
 public static void RegisterDefaults(this XafApplication application, params ModuleBase[] modules)
 {
     application.AlwaysUpdateOnDatabaseVersionMismatch().Subscribe();
     application.Modules.AddRange(modules);
     application.RegisterInMemoryObjectSpaceProvider();
     MockFrameTemplate(application);
 }
示例#4
0
        public static void RegisterDefaults(this XafApplication application, params ModuleBase[] modules)
        {
            if (modules.Any() && application.Security is SecurityStrategyComplex)
            {
                if (!modules.OfType <TestApplicationModule>().Any())
                {
                    modules = modules.Add(new TestApplicationModule()).ToArray();
                }
            }

            application.AlwaysUpdateOnDatabaseVersionMismatch().Subscribe();
            object instance;
            var    platform = application.GetPlatform();

            if (platform == Platform.Win)
            {
                instance = (ModuleBase)AppDomain.CurrentDomain
                           .GetAssemblyType("DevExpress.ExpressApp.Win.SystemModule.SystemWindowsFormsModule")
                           .CreateInstance();
            }
            else if (platform == Platform.Web)
            {
                instance = AppDomain.CurrentDomain
                           .GetAssemblyType("DevExpress.ExpressApp.Web.SystemModule.SystemAspNetModule")
                           .CreateInstance();
            }
            else
            {
                instance = AppDomain.CurrentDomain
                           .GetAssemblyType("DevExpress.ExpressApp.Blazor.SystemModule.SystemBlazorModule")
                           .CreateInstance();
            }
            var moduleBases = new[] {
                new SystemModule(),
                instance
            }
            .Concat(modules)
            .Concat(new [] { new ReactiveLoggerModule() })
            ;

            if (((ITestApplication)application).TransmitMessage)
            {
                if (Process.GetProcessesByName("Xpand.XAF.Modules.Reactive.Logger.Client.Win").Any())
                {
                    moduleBases = moduleBases.Add(new ReactiveLoggerHubModule());
                }
            }

            foreach (var moduleBase in moduleBases)
            {
                if (application.Modules.All(_ => moduleBase.GetType() != _.GetType()))
                {
                    application.Modules.AddRange(new [] { moduleBase });
                }
            }

            application.AddObjectSpaceProvider();
        }
示例#5
0
        public static void RegisterDefaults(this XafApplication application, params ModuleBase[] modules)
        {
            application.AlwaysUpdateOnDatabaseVersionMismatch().Subscribe();
            var moduleBases = new[] {
                new SystemModule(),
                application is WinApplication ? (ModuleBase) new SystemWindowsFormsModule() : new SystemAspNetModule()
            }.Concat(modules);

            foreach (var moduleBase in moduleBases)
            {
                if (application.Modules.FindModule(moduleBase.GetType()) == null)
                {
                    application.Modules.Add(moduleBase);
                }
            }

            application.RegisterInMemoryObjectSpaceProvider();
        }
示例#6
0
        public static void RegisterDefaults(this XafApplication application, params ModuleBase[] modules)
        {
            if (modules.Any() && application.Security is SecurityStrategyComplex)
            {
                modules = modules.Add(new ModuleUpdaterModule()).ToArray();
            }
            application.AlwaysUpdateOnDatabaseVersionMismatch().Subscribe();
            var moduleBases = new[] {
                new ReactiveLoggerHubModule(),
                new SystemModule(),
                application is WinApplication ? (ModuleBase) new SystemWindowsFormsModule() : new SystemAspNetModule()
            }.Concat(modules);

            foreach (var moduleBase in moduleBases)
            {
                if (application.Modules.All(_ => moduleBase.GetType() != _.GetType()))
                {
                    application.Modules.Add(moduleBase);
                }
            }

            application.RegisterInMemoryObjectSpaceProvider();
        }