Exemplo n.º 1
0
    private static bool BootstrapTileShop(string logFileName)
    {
        try
        {
            var bootstrapper = new BootstrapService(LoggerFactory.CreateLogger <BootstrapService>());

            var settingsFileName       = Path.Combine(AppContext.BaseDirectory, BootstrapService.DefaultConfigurationFileName);
            var codecPath              = Path.Combine(AppContext.BaseDirectory, BootstrapService.DefaultCodecPath);
            var codecSchemaFileName    = Path.Combine(AppContext.BaseDirectory, BootstrapService.DefaultCodecSchemaFileName);
            var palettePath            = Path.Combine(AppContext.BaseDirectory, BootstrapService.DefaultPalettePath);
            var pluginPath             = Path.Combine(AppContext.BaseDirectory, BootstrapService.DefaultPluginPath);
            var resourceSchemaFileName = Path.Combine(AppContext.BaseDirectory, BootstrapService.DefaultResourceSchemaFileName);

            var settings       = bootstrapper.ReadConfiguration(settingsFileName);
            var codecService   = bootstrapper.CreateCodecService(codecPath, codecSchemaFileName);
            var paletteService = bootstrapper.CreatePaletteService(palettePath, settings);
            //var pluginService = bootstrapper.CreatePluginService(pluginPath, codecService);

            var defaultResources  = paletteService.GlobalPalettes;
            var serializerFactory = new XmlProjectSerializerFactory(resourceSchemaFileName,
                                                                    codecService.CodecFactory, paletteService.ColorFactory, defaultResources);
            ProjectService = bootstrapper.CreateProjectService(serializerFactory, paletteService.ColorFactory);

            return(true);
        }
        catch (Exception ex)
        {
            Log.Fatal(ex, $"TileShopCLI environment failed to load:\n{ex.StackTrace}\n");
            return(false);
        }
    }
Exemplo n.º 2
0
        public static async Task Main(string[] args)
        {
            BootstrapService bootstrapper = new BootstrapService();
            ProgramManager   program      = new ProgramManager(bootstrapper.ServiceProvider);
            await program.Start(args);

            Console.ReadKey();
        }
Exemplo n.º 3
0
        protected override async void OnStartup(StartupEventArgs e)
        {
            var appIcon            = TestUI.Properties.Resources.M;
            var assemblyParameters = ContainerConfiguration.CreateFromAssembly(typeof(App).Assembly);

            var appConfig = ApplicationConfiguration.CreateFromIcon("Hello Test", appIcon);
            await BootstrapService.StartUpAsync(assemblyParameters, appConfig, Maybe.CreateNone <Action>());
        }
Exemplo n.º 4
0
        protected override async void OnStartup(StartupEventArgs e)
        {
            var appIcon            = WpfUI.Properties.Resources.M;
            var assemblyParameters = AssemblyParameters.CreateFromAssembly(typeof(App).Assembly);

            var appConfig = ApplicationConfiguration.CreateFromIcon("Word Analysis System", appIcon);
            await BootstrapService.StartUpAsync(assemblyParameters, appConfig);
        }
Exemplo n.º 5
0
        protected override async void OnStartup(StartupEventArgs e)
        {
            var thisAssembly = typeof(App).Assembly;
            var appIcon      = WpfUI.Properties.Resources.M;

            var appConfig = ApplicationConfiguration.CreateFromIcon("Know-how Management System", appIcon);

            await BootstrapService.StartUpAsync(new AssemblyParameters(thisAssembly, "Mmu.Kms"), appConfig);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Used to execute rules.
        /// </summary>
        /// <returns></returns>
        public IRuleResult[] Execute()
        {
            if (!_rules.Any())
            {
                return(_ruleService.GetRuleResults());
            }

            var rules = new BootstrapService <T>(_model, _ruleEngineId, _dependencyResolver)
                        .Bootstrap(_rules);

            _ruleService = new RuleService <T>(_model, rules, _ruleEngineConfiguration);

            _ruleService.Invoke();

            return(_ruleService.GetRuleResults());
        }
Exemplo n.º 7
0
        /// <summary>
        /// Used to execute rules.
        /// </summary>
        /// <returns></returns>
        public IEnumerable <IRuleResult> Execute()
        {
            if (!_rules.Any())
            {
                return(Enumerable.Empty <IRuleResult>().ToArray());
            }

            var rules = new BootstrapService <T>(_model, _ruleEngineId, _dependencyResolver)
                        .Bootstrap(_rules);

            _ruleService = new RuleService <T>(rules, _ruleEngineConfiguration);

            _ruleService.Invoke();

            return(_ruleService.GetRuleResults());
        }
Exemplo n.º 8
0
    private void ConfigureImageMagitek(ContainerBuilder builder)
    {
        var bootstrapper   = new BootstrapService(_loggerFactory.CreateLogger <BootstrapService>());
        var settings       = bootstrapper.ReadConfiguration(BootstrapService.DefaultConfigurationFileName);
        var paletteService = bootstrapper.CreatePaletteService(BootstrapService.DefaultPalettePath, settings);
        var codecService   = bootstrapper.CreateCodecService(BootstrapService.DefaultCodecPath, BootstrapService.DefaultCodecSchemaFileName);
        var pluginService  = bootstrapper.CreatePluginService(BootstrapService.DefaultPluginPath, codecService);
        var layoutService  = bootstrapper.CreateTileLayoutService(BootstrapService.DefaultLayoutsPath);

        var defaultResources  = paletteService.GlobalPalettes;
        var serializerFactory = new XmlProjectSerializerFactory(BootstrapService.DefaultResourceSchemaFileName,
                                                                codecService.CodecFactory, paletteService.ColorFactory, defaultResources);
        var projectService = bootstrapper.CreateProjectService(serializerFactory, paletteService.ColorFactory);

        builder.RegisterInstance(settings);
        builder.RegisterInstance(paletteService);
        builder.RegisterInstance(codecService);
        builder.RegisterInstance(pluginService);
        builder.RegisterInstance(layoutService);
        builder.RegisterInstance(projectService);
    }
Exemplo n.º 9
0
 private static void Main()
 {
     BootstrapService.Start(typeof(Program).Assembly);
     System.Windows.Forms.Application.Run();
 }
Exemplo n.º 10
0
 private static void Main()
 {
     BootstrapService.Start();
     Application.Run();
 }
Exemplo n.º 11
0
 public void setBootstrapService(BootstrapService bootstrapService)
 {
     this.bootstrapService = bootstrapService;
 }