Exemplo n.º 1
0
        private void Init(IWindowProvider <IVisualHost> windowProvider,
                          IThemeProvider themeProvider,
                          IViewPerspective viewPerspective,
                          Dictionary <IVisualElement, ValueCube> renderPositions,
                          ref GdiImageProvider?imageProvider,
                          ref GdiMeasureContext measureContext,
                          ref GdiRenderContext renderContext)
        {
            imageProvider = new GdiImageProvider();
            var lastMeasure   = new Dictionary <IVisualElement, ValueSize>();
            var visualLineage = new VisualLineage();

            measureContext = new GdiMeasureContext(this, lastMeasure,
                                                   themeProvider, visualLineage, VisualBootstrapper.LayoutQueue);

            renderContext = new GdiRenderContext(viewPerspective,
                                                 MeasureContext.Graphics, this, lastMeasure,
                                                 renderPositions, themeProvider, visualLineage, VisualBootstrapper.LayoutQueue);

            Container.ResolveTo <IImageProvider>(imageProvider);
            Container.ResolveTo <IUiProvider>(new GdiUiProvider(windowProvider));
            Container.ResolveTo(themeProvider);

            windowProvider.WindowShown += OnWindowShown;

            RegisterSurrogate <HtmlPanel>(GetHtmlPanelSurrogate);
        }
Exemplo n.º 2
0
        public GdiRenderKit(IViewPerspective viewPerspective,
                            IWindowProvider <IVisualHost> windowProvider)
        {
            MeasureContext = new GdiMeasureContext();
            RenderContext  = new GdiRenderContext(MeasureContext,
                                                  viewPerspective, MeasureContext.Graphics);

            _containedObjects[typeof(IImageProvider)] = RenderContext;

            windowProvider.WindowShown += OnWindowShown;
        }
Exemplo n.º 3
0
        //public StaticGdiRenderKit(IViewPerspective viewPerspective,
        //                          IMultiSerializer xmlSerializer)
        //: this(viewPerspective, xmlSerializer)
        //{}

        public StaticGdiRenderKit(IViewPerspective viewPerspective,
                                  IMultiSerializer xmlSerializer)
            : base(new GdiImageProvider(), xmlSerializer,
                   NullSvgBuilder.Instance, null)
        {
            var defaultSurrogates = new BaseSurrogateProvider();

            var lastMeasure   = new Dictionary <IVisualElement, ValueSize>();
            var visualLineage = new VisualLineage();
            var layoutQueue   = new LayoutQueue();

            MeasureContext = new GdiMeasureContext(defaultSurrogates, lastMeasure,
                                                   BaselineThemeProvider.Instance, visualLineage, layoutQueue);

            RenderContext = new GdiRenderContext(viewPerspective,
                                                 MeasureContext.Graphics, defaultSurrogates, lastMeasure,
                                                 new Dictionary <IVisualElement, ValueCube>(),
                                                 BaselineThemeProvider.Instance, visualLineage, layoutQueue);
        }