コード例 #1
0
        public TableBoxDecoration()
        {
            FieldBackgroundColor = new AutoColor();
            FieldTextColor       = new AutoColor();

            Border      = new Border();
            BorderColor = new AutoColor();

            TextFont = new AutoFont();

            HorizontalLinesVisible = true;
            VerticalLinesVisible   = true;

            HeaderBackgroundColor = new AutoColor();
            HeaderTextColor       = new AutoColor();

            FooterBackgroundColor = new AutoColor();
            FooterTextColor       = new AutoColor();

            SelectionBackgroundColor = new AutoColor();
            SelectionTextColor       = new AutoColor();

            InterlacingColor = new AutoColor();

            HeaderTextFont = new AutoFont();
            FooterTextFont = new AutoFont();
        }
コード例 #2
0
        public void FontListener_Get_ReturnsParsedAutoFont()
        {
            // Given.
            var input    = "{7, 3, 12, 700, 1, 1, 100}";
            var expected = new AutoFont
            {
                Bold   = true,
                Italic = true,
                Scale  = 100,
            };

            var parser = CreateParser(input);
            var tree   = parser.font();

            WalkParseTree(tree);

            // When.
            var font = TestSubject.Get(tree);

            // Then.
            font.Should().BeOfType <AutoFont>()
            .And.BeEquivalentTo(expected);

            TestSubject.Received(1)
            .FillRelativeFont((RelativeFont)font, tree.relativeFont());
        }
コード例 #3
0
        private AutoFont ParseAutoFont(OrdinaryFormParser.RelativeFontContext context)
        {
            var font = new AutoFont();

            FillRelativeFont(font, context);

            return(font);
        }
コード例 #4
0
        public TableBoxColumnDecoration()
        {
            HorizontalAlign = HorizontalTextAlignment.Auto;

            BackgroundColor = new AutoColor();
            TextColor       = new AutoColor();

            TextFont = new AutoFont();

            Picture = new EmptyPicture();
        }
コード例 #5
0
        public PictureBoxDecoration()
        {
            BackgroundColor = new AutoColor();
            TextColor       = new AutoColor();

            Border      = new Border();
            BorderColor = new AutoColor();

            TextFont = new AutoFont();

            Picture     = new EmptyPicture();
            PictureSize = PictureSize.RealSize;
        }
コード例 #6
0
        public void FontListener_FillRelativeFont_FillsRelativeFontOptionalValues(string input, RelativeFont expected)
        {
            // Given.
            var font = new AutoFont();

            var parser = CreateParser(input);
            var tree   = parser.font();

            WalkParseTree(tree);

            // When.
            TestSubject.FillRelativeFont(font, tree.relativeFont());

            // Then.
            font.Should().BeEquivalentTo(expected, opt => opt
                                         .Excluding(x => x.Type));
        }
コード例 #7
0
        public ButtonDecoration()
        {
            TextAlignment = new TextAlignment
            {
                Horizontal = HorizontalTextAlignment.Center,
                Vertical   = VerticalTextAlignment.Center,
            };

            BackgroundColor = new AutoColor();
            TextColor       = new AutoColor();

            BorderColor = new AutoColor();

            TextFont = new AutoFont();

            PicturePosition = ButtonPicturePosition.Left;
            Picture         = new EmptyPicture();
            PictureSize     = PictureSize.AutoSize;
        }
コード例 #8
0
        public TextBoxDecoration()
        {
            TextAlignment = new TextAlignment
            {
                Horizontal = HorizontalTextAlignment.Auto,
                Vertical   = VerticalTextAlignment.Top,
            };

            FieldBackgroundColor = new AutoColor();
            FieldTextColor       = new AutoColor();

            ButtonBackgroundColor = new AutoColor();
            ButtonTextColor       = new AutoColor();

            Border      = new Border();
            BorderColor = new AutoColor();

            TextFont = new AutoFont();

            Picture             = new EmptyPicture();
            ChoiceButtonPicture = new EmptyPicture();
        }
コード例 #9
0
        private static IEnumerable <TestCaseData> GetRelativeFontCases()
        {
            string       input;
            RelativeFont expected;

            input    = "{7, 3, 0, 1, 100}";
            expected = new AutoFont
            {
                Scale = 100,
            };

            yield return
                (new TestCaseData(input, expected)
                 .SetArgDisplayNames("Без изменений"));

            input    = "{7, 3, 4, 400, 1, 110}";
            expected = new AutoFont
            {
                Bold  = false,
                Scale = 110,
            };

            yield return
                (new TestCaseData(input, expected)
                 .SetArgDisplayNames("Полужирный"));

            input    = "{7, 3, 8, 1, 1, 120}";
            expected = new AutoFont
            {
                Italic = true,
                Scale  = 120,
            };

            yield return
                (new TestCaseData(input, expected)
                 .SetArgDisplayNames("Курсив"));

            input    = "{7, 3, 12, 700, 0, 1, 130}";
            expected = new AutoFont
            {
                Bold   = true,
                Italic = false,
                Scale  = 130,
            };

            yield return
                (new TestCaseData(input, expected)
                 .SetArgDisplayNames("Полужирный и курсив"));

            input    = "{7, 3, 1, \"Times New Roman\", 1, 140}";
            expected = new AutoFont
            {
                FaceName = "Times New Roman",
                Scale    = 140,
            };

            yield return
                (new TestCaseData(input, expected)
                 .SetArgDisplayNames("Имя шрифта"));

            input    = "{7, 3, 61, 700, 1, 1, 1, \"Arial\", 1, 150}";
            expected = new AutoFont
            {
                Bold      = true,
                Italic    = true,
                Underline = true,
                Strikeout = true,
                FaceName  = "Arial",
                Scale     = 150,
            };

            yield return
                (new TestCaseData(input, expected)
                 .SetArgDisplayNames("Полностью заполнен"));

            input    = "{7, 1, 61, { 0 }, 700, 1, 1, 1, \"Lucida Console\", 1, 160}";
            expected = new WindowsFont
            {
                Bold      = true,
                Italic    = true,
                Underline = true,
                Strikeout = true,
                FaceName  = "Lucida Console",
                Scale     = 160,
            };

            yield return
                (new TestCaseData(input, expected)
                 .SetArgDisplayNames("Полностью заполненный StyleBasedFont"));
        }