Example #1
0
        ///<summary>
        ///Returns a new Font object from the style information provided
        ///</summary>
        public Font ToFont()
        {
            Font font = new Font();

            if (Italic != null)
            {
                font.AppendChild <Italic>(new Italic());
            }
            if (Bold != null)
            {
                font.AppendChild <Bold>(new Bold());
            }
            if (Underline != null)
            {
                font.AppendChild <Underline>(new Underline());
            }

            if (Color != null)
            {
                font.AppendChild <Color>(Color.CloneElement <Color>());
            }
            if (FontSize != null)
            {
                font.AppendChild <FontSize>(FontSize.CloneElement <FontSize>());
            }
            if (FontName != null)
            {
                font.AppendChild <FontName>(FontName.CloneElement <FontName>());
            }
            if (FontFamily != null)
            {
                font.AppendChild <FontFamily>(FontFamily.CloneElement <FontFamily>());
            }
            if (FontScheme != null)
            {
                font.AppendChild <FontScheme>(FontScheme.CloneElement <FontScheme>());
            }

            return(font);
        }