Ejemplo n.º 1
0
        public void AdapterBorderProperties()
        {
            const string image       = "abc123.png";
            LayoutBox    borderSlice = new LayoutBox {
                Left = 2, Top = 3, Right = 4, Bottom = 5
            };

            InitializeBorder(image, borderSlice);

            var facet = new ResourceManagerInitializer.TestFacet();

            uiManager.InitializeFacet(facet);

            var adapter = facet.InterfaceRoot.Renderer.Adapter;
            var style   = adapter.StyleOf(facet.WindowA);

            Assert.AreEqual(image, style.Border.Image);
            Assert.AreEqual(borderSlice, style.Border.ImageSlice);
            //Assert.AreEqual("ui_back_1.png", style.Border.Left.Width);
            //Assert.AreEqual("ui_back_1.png", style.Border.Left.Color);
            //Assert.AreEqual("ui_back_1.png", style.Border.Top.Width);
            //Assert.AreEqual("ui_back_1.png", style.Border.Top.Color);
            //Assert.AreEqual("ui_back_1.png", style.Border.Right.Width);
            //Assert.AreEqual("ui_back_1.png", style.Border.Right.Color);
            //Assert.AreEqual("ui_back_1.png", style.Border.Bottom.Width);
            //Assert.AreEqual("ui_back_1.png", style.Border.Bottom.Color);
        }
Ejemplo n.º 2
0
        public void AdapterBackgroundProperties()
        {
            var facet = new ResourceManagerInitializer.TestFacet();

            uiManager.InitializeFacet(facet);

            var adapter = facet.InterfaceRoot.Renderer.Adapter;
            var style   = adapter.StyleOf(facet.WindowA);

            Assert.AreEqual("ui_back_1.png", style.Background.Image);
            Assert.AreEqual(Color.Blue, style.Background.Color);
            Assert.AreEqual(BackgroundRepeat.None, style.Background.Repeat);
            Assert.AreEqual(BackgroundClip.Content, style.Background.Clip);
            Assert.AreEqual(new Point(4, 3), style.Background.Position);
        }
Ejemplo n.º 3
0
        public void AdapterFontProperties()
        {
            const string     fontname   = "Times New Roman";
            const int        fontSize   = 14;
            const FontStyles fontStyles = FontStyles.Bold | FontStyles.Italic;

            InitializeFontProperties(fontname, fontSize, fontStyles, Color.LightBlue);

            var facet = new ResourceManagerInitializer.TestFacet();

            uiManager.InitializeFacet(facet);

            var adapter = facet.InterfaceRoot.Renderer.Adapter;
            var style   = adapter.StyleOf(facet.WindowA);

            Assert.AreEqual(fontname, style.Font.Family);
            Assert.AreEqual(fontSize, style.Font.Size);
            Assert.AreEqual(fontStyles, style.Font.Style);
            Assert.AreEqual(Color.LightBlue, style.Font.Color);
        }
Ejemplo n.º 4
0
        public void AdapterBoxModel()
        {
            const string image       = "abc123.png";
            LayoutBox    borderSlice = new LayoutBox {
                Left = 2, Top = 3, Right = 4, Bottom = 5
            };

            InitializeBorder(image, borderSlice);

            var facet = new ResourceManagerInitializer.TestFacet();

            uiManager.InitializeFacet(facet);

            var adapter = facet.InterfaceRoot.Renderer.Adapter;
            var style   = adapter.StyleOf(facet.WindowA);

            Assert.AreEqual(2, style.BoxModel.Border.Left);
            Assert.AreEqual(3, style.BoxModel.Border.Top);
            Assert.AreEqual(4, style.BoxModel.Border.Right);
            Assert.AreEqual(5, style.BoxModel.Border.Bottom);
        }