Exemplo n.º 1
2
        public override void PopulateFromXElement(XElement element)
        {
            base.PopulateFromXElement(element);

            XNamespace xmlns = element.Name.Namespace;

            HorizontalAlignment = element.Attribute("horizontalAlignment").NullableEnum<PdfHorizontalAlignment>();
            BackgroundColor = element.Attribute("backgroundColor").NullableColor();
            BorderColor = element.Attribute("borderColor").NullableColor();
            Padding = element.Attribute("padding").NullableFloat();
            Leading = element.Attribute("leading").NullableFloat();
            BorderWidth = element.Attribute("borderWidth").NullableFloat();
            TopIndent = element.Attribute("topIndent").NullableFloat();
            BottomIndent = element.Attribute("bottomIndent").NullableFloat();
            Width = PdfUnit.Parse(element.Attribute("width").Optional());
        }
Exemplo n.º 2
2
        public override void Merge(PdfElementStyle style)
        {
            PdfPanelStyle panelStyle = style as PdfPanelStyle;
            base.Merge(panelStyle);

            if (panelStyle.HorizontalAlignment.HasValue)
            {
                HorizontalAlignment = panelStyle.HorizontalAlignment;
            }
            if (panelStyle.BackgroundColor.HasValue)
            {
                BackgroundColor = panelStyle.BackgroundColor;
            }
            if (panelStyle.BorderColor.HasValue)
            {
                BorderColor = panelStyle.BorderColor;
            }
            if (panelStyle.Padding.HasValue)
            {
                Padding = panelStyle.Padding;
            }
            if (panelStyle.Leading.HasValue)
            {
                Leading = panelStyle.Leading;
            }
            if (panelStyle.BorderWidth.HasValue)
            {
                BorderWidth = panelStyle.BorderWidth;
            }
            if (panelStyle.TopIndent.HasValue)
            {
                TopIndent = panelStyle.TopIndent;
            }
            if (panelStyle.BottomIndent.HasValue)
            {
                BottomIndent = panelStyle.BottomIndent;
            }
            if (panelStyle.Width.HasValue && !panelStyle.Width.Value.IsBlank)
            {
                Width = panelStyle.Width;
            }
        }