Пример #1
0
        private void InitializeExportImport()
        {
            var exporters = registry.GetRegistered <IExport>();
            var importers = registry.GetRegistered <IImport>();

            fileHandler.InitializeExportImport(exporters, importers);

            // Ggf. Import bzw. Export-Menü entfernen
            if (importers.Length == 0)
            {
                fileMenu.Items.Remove(importMenu);
            }
        }
Пример #2
0
        public void BootstrapExtensions()
        {
            if (Logger == null || RootForm == null)
            {
                throw new InvalidOperationException("Bootstrapper was not fully initialized before attempted to bootstrap extensions!");
            }

            if (!extensionsPreLoaded)
            {
                throw new InvalidOperationException("Extensions have not been preloaded before attempting to initializing them!");
            }

            // Initialize (already loaded) extensions (==> base for the next steps)
            ExtensionManager.InitActivatedExtensions(registry);

            // Initialize Export/Import
            var exporters = GetRegistered <IExport>();
            var importers = GetRegistered <IImport>();

            FileHandler.InitializeExportImport(exporters, importers);

            // Load templates from files & extensions
            var templatePath    = settings.Get("tmpl.root", DEFAULT_TEMPLATE_PATH);
            var templateManager = new TemplateManager(registry, this, templatePath);

            templateManager.LoadTemplates(templatePath);
            if (OptionsParser.TemplateDebug)
            {
                Task.Run(() => Application.Instance.Invoke(() => templateManager.DebugCompileAll()));
            }
            TemplateManager = templateManager;

            ExtensionsLoaded?.Invoke(this, new EventArgs());

            (RootForm as Window) !.Closing += (s, e) => AppClosing?.Invoke(this, null);
        }