Beispiel #1
0
        private void RegisterRenderers()
        {
            try
            {
                Type t = typeof(DxResultRendererFactory);
                IResultRendererFactory factory = Activator.CreateInstance(t) as IResultRendererFactory;

                ResultRendererSpec spec = new ResultRendererSpec();
                spec.Name         = factory.FactoryName;
                spec.Description  = factory.FactoryDescription;
                spec.FullName     = String.Format("{0}, {1}", t.FullName, t.Assembly.FullName);
                spec.RendererType = t;

                HostServicesSingleton.HostServices.ResultRendererService.Register(spec);

                t       = typeof(DxResultRendererFactory_AllInOne);
                factory = Activator.CreateInstance(t) as IResultRendererFactory;

                spec              = new ResultRendererSpec();
                spec.Name         = factory.FactoryName;
                spec.Description  = factory.FactoryDescription;
                spec.FullName     = String.Format("{0}, {1}", t.FullName, t.Assembly.FullName);
                spec.RendererType = t;

                HostServicesSingleton.HostServices.ResultRendererService.Register(spec);
            }
            catch (Exception ex)
            {
                GenericErrorDialog.ShowError("PragmaSQL.DxResultRenderer Error", "Can not register result renderers.", ex);
            }
        }
Beispiel #2
0
        internal void RegisterDefaultResultRenderers()
        {
            Type t = typeof(ResultRendererFactory_SeperatePageForEach);
            IResultRendererFactory factory = Activator.CreateInstance(t) as IResultRendererFactory;

            ResultRendererSpec spec = new ResultRendererSpec();

            spec.Name         = factory.FactoryName;
            spec.Description  = factory.FactoryDescription;
            spec.FullName     = String.Format("{0}, {1}", t.FullName, t.Assembly.FullName);
            spec.RendererType = t;

            _resultRendererService.Register(spec);

            if (String.IsNullOrEmpty(Program.MainForm.DefaultResultRenderer))
            {
                Program.MainForm.DefaultResultRenderer = spec.Name;
            }

            t       = typeof(ResultRendererFactory_AllInOnePage);
            factory = Activator.CreateInstance(t) as IResultRendererFactory;

            spec              = new ResultRendererSpec();
            spec.Name         = factory.FactoryName;
            spec.Description  = factory.FactoryDescription;
            spec.FullName     = String.Format("{0}, {1}", t.FullName, t.Assembly.FullName);
            spec.RendererType = t;
            _resultRendererService.Register(spec);
        }