Ejemplo n.º 1
0
        public void Init(IPluginInterface pluginInterface, IComponentRegistry componentRegistry)
        {
            var export  = new DefaultTemplateExport(T._("Aushangfahrplan HTML Datei (*.html)|*.html"), GetTemplateChooser);
            var preview = new DefaultPreview("afpl", T._("Aushangfahrplan"), export);

            componentRegistry.Register <IExport>(export);
            componentRegistry.Register <IPreviewAction>(preview);

            componentRegistry.Register <IAppearanceControl>(new DefaultAppearanceControl(pi => new SettingsControl(pi), T._("Aushangfahrplan")));
            componentRegistry.Register <IFilterRuleContainer>(FilterRuleContainer);

            componentRegistry.Register <ITemplateProvider>(new Templates.StdTemplateProvider());
            componentRegistry.Register <ITemplateProvider>(new Templates.SvgTemplateProvider());

            componentRegistry.Register <ITemplateWhitelistEntry>(new TemplateWhitelistEntry <Templates.TemplateHelper>("afpl"));
            componentRegistry.Register <ITemplateWhitelistEntry>(new TemplateWhitelistEntry <AfplAttrs>("afpl"));
        }
Ejemplo n.º 2
0
        public void Init(IPluginInterface pluginInterface, IComponentRegistry componentRegistry)
        {
            var export  = new DefaultTemplateExport(T._("Tabellenfahrplan/Kursbuch als HTML Datei (*.html)|*.html"), GetTemplateChooser);
            var preview = new DefaultPreview("kfpl", T._("Kursbuch"), export);

            componentRegistry.Register <IExport>(export);
            componentRegistry.Register <IPreviewAction>(preview);

            componentRegistry.Register <IFilterRuleContainer>(FilterRuleContainer);
            componentRegistry.Register <IAppearanceControl>(new DefaultAppearanceControl(pi => new SettingsControl(pi), T._("Kursbuch")));

            componentRegistry.Register <ITemplateProvider>(new Templates.TemplateProvider());

            componentRegistry.Register <ITemplateWhitelistEntry>(new TemplateWhitelistEntry <Templates.TemplateHelper>("kfpl"));
            componentRegistry.Register <ITemplateWhitelistEntry>(new TemplateWhitelistEntry <KfplAttrs>("kfpl"));

            componentRegistry.Register <ITimetableTypeChangeAction>(new FixAttrsAction());
        }
Ejemplo n.º 3
0
        public void Init(IPluginInterface pluginInterface, IComponentRegistry componentRegistry)
        {
            var export  = new DefaultTemplateExport("Buchfahrplan als HTML Datei (*.html)|*.html", GetTemplateChooser);
            var preview = new DefaultPreview("bfpl", "Buchfahrplan", export);

            componentRegistry.Register <IExport>(export);
            componentRegistry.Register <IPreviewAction>(preview);

            componentRegistry.Register <IAppearanceControl>(new DefaultAppearanceControl(pi => new Forms.SettingsControl(pi), "Buchfahrplan"));
            componentRegistry.Register <IFilterRuleContainer>(FilterRuleContainer);
            componentRegistry.Register <IRouteAction>(new Forms.VelocityRouteAction());

            componentRegistry.Register <ITemplateProvider>(new Templates.StdTemplate());
            componentRegistry.Register <ITemplateProvider>(new Templates.ZlbTemplate());

            componentRegistry.Register <ITemplateWhitelistEntry>(new TemplateWhitelistEntry <Templates.TemplateHelper>("bfpl"));
            componentRegistry.Register <ITemplateWhitelistEntry>(new TemplateWhitelistEntry <Model.BfplAttrs>("bfpl"));
            componentRegistry.Register <ITemplateWhitelistEntry>(new TemplateWhitelistEntry <Model.BfplPoint>("bfpl"));
        }
Ejemplo n.º 4
0
        public FlowDocument RenderPreview()
        {
            var previewer = ScoredResult.Result.Preview;

            if (previewer == null)
                previewer = new DefaultPreview(this.ScoredResult.Result);

            FlowDocument document;

            try
            {
                document = (FlowDocument)XamlReader.Parse(previewer.Document);
            }
            catch (Exception ex)
            {
                previewer = new RenderIssuePreview(this.ScoredResult.Result, ex);
                document = (FlowDocument)XamlReader.Parse(previewer.Document);
            }

            document.DataContext = previewer;

            return document;
        }