/// <summary>
        ///     Clone a new instance of SLFont with identical font settings.
        /// </summary>
        /// <returns>An SLFont object with identical font settings.</returns>
        public SLFont Clone()
        {
            var font = new SLFont(MajorFont, MinorFont, listThemeColors, listIndexedColors);

            font.FontName             = FontName;
            font.CharacterSet         = CharacterSet;
            font.FontFamily           = FontFamily;
            font.Bold                 = Bold;
            font.Italic               = Italic;
            font.Strike               = Strike;
            font.Outline              = Outline;
            font.Shadow               = Shadow;
            font.Condense             = Condense;
            font.Extend               = Extend;
            font.clrFontColor         = clrFontColor.Clone();
            font.HasFontColor         = HasFontColor;
            font.FontSize             = FontSize;
            font.vUnderline           = vUnderline;
            font.HasUnderline         = HasUnderline;
            font.vVerticalAlignment   = vVerticalAlignment;
            font.HasVerticalAlignment = HasVerticalAlignment;
            font.vFontScheme          = vFontScheme;
            font.HasFontScheme        = HasFontScheme;

            return(font);
        }
Beispiel #2
0
        internal void FromDifferentialType(X14.DifferentialType dt)
        {
            SetAllNull();

            var listempty = new List <Color>();

            if (dt.Font != null)
            {
                HasFont  = true;
                fontReal = new SLFont(SLConstants.OfficeThemeMajorLatinFont, SLConstants.OfficeThemeMinorLatinFont,
                                      listempty, listempty);
                fontReal.FromFont(dt.Font);
            }

            if (dt.NumberingFormat != null)
            {
                HasNumberingFormat = true;
                nfFormatCode       = new SLNumberingFormat();
                nfFormatCode.FromNumberingFormat(dt.NumberingFormat);
            }

            if (dt.Fill != null)
            {
                HasFill  = true;
                fillReal = new SLFill(listempty, listempty);
                fillReal.FromFill(dt.Fill);
            }

            if (dt.Alignment != null)
            {
                HasAlignment = true;
                alignReal    = new SLAlignment();
                alignReal.FromAlignment(dt.Alignment);
            }

            if (dt.Border != null)
            {
                HasBorder  = true;
                borderReal = new SLBorder(listempty, listempty);
                borderReal.FromBorder(dt.Border);
            }

            if (dt.Protection != null)
            {
                HasProtection  = true;
                protectionReal = new SLProtection();
                protectionReal.FromProtection(dt.Protection);
            }

            Sync();
        }
Beispiel #3
0
        private void SetAllNull()
        {
            var listempty = new List <Color>();

            alignReal          = new SLAlignment();
            HasAlignment       = false;
            protectionReal     = new SLProtection();
            HasProtection      = false;
            nfFormatCode       = new SLNumberingFormat();
            HasNumberingFormat = false;
            fontReal           = new SLFont(SLConstants.OfficeThemeMajorLatinFont, SLConstants.OfficeThemeMinorLatinFont,
                                            listempty, listempty);
            HasFont    = false;
            fillReal   = new SLFill(listempty, listempty);
            HasFill    = false;
            borderReal = new SLBorder(listempty, listempty);
            HasBorder  = false;
        }