Пример #1
0
        internal SLColor Clone()
        {
            var clr = new SLColor(listThemeColors, listIndexedColors);

            clr.clrDisplay = clrDisplay;
            clr.Auto       = Auto;
            clr.Indexed    = Indexed;
            clr.Rgb        = Rgb;
            clr.Theme      = Theme;
            clr.Tint       = Tint;

            return(clr);
        }
Пример #2
0
        internal void FromBorderPropertiesType(VerticalBorder border)
        {
            if (border.Color != null)
            {
                clrReal = new SLColor(listThemeColors, listIndexedColors);
                clrReal.FromSpreadsheetColor(border.Color);
                HasColor = !clrReal.IsEmpty();
            }
            else
            {
                RemoveColor();
            }

            if (border.Style != null)
            {
                BorderStyle = border.Style.Value;
            }
            else
            {
                RemoveBorderStyle();
            }
        }
Пример #3
0
 private void SetAllNull()
 {
     FontName             = null;
     CharacterSet         = null;
     FontFamily           = null;
     Bold                 = null;
     Italic               = null;
     Strike               = null;
     Outline              = null;
     Shadow               = null;
     Condense             = null;
     Extend               = null;
     clrFontColor         = new SLColor(listThemeColors, listIndexedColors);
     HasFontColor         = false;
     FontSize             = null;
     vUnderline           = UnderlineValues.None;
     HasUnderline         = false;
     vVerticalAlignment   = VerticalAlignmentRunValues.Baseline;
     HasVerticalAlignment = false;
     vFontScheme          = FontSchemeValues.None;
     HasFontScheme        = false;
 }
Пример #4
0
        internal void FromFont(Font f)
        {
            SetAllNull();

            if ((f.FontName != null) && (f.FontName.Val != null))
            {
                FontName = f.FontName.Val.Value;
            }

            if ((f.FontCharSet != null) && (f.FontCharSet.Val != null))
            {
                CharacterSet = f.FontCharSet.Val.Value;
            }

            if ((f.FontFamilyNumbering != null) && (f.FontFamilyNumbering.Val != null))
            {
                FontFamily = f.FontFamilyNumbering.Val.Value;
            }

            if (f.Bold != null)
            {
                if (f.Bold.Val == null)
                {
                    Bold = true;
                }
                else if (f.Bold.Val.Value)
                {
                    Bold = true;
                }
            }

            if (f.Italic != null)
            {
                if (f.Italic.Val == null)
                {
                    Italic = true;
                }
                else if (f.Italic.Val.Value)
                {
                    Italic = true;
                }
            }

            if (f.Strike != null)
            {
                if (f.Strike.Val == null)
                {
                    Strike = true;
                }
                else if (f.Strike.Val.Value)
                {
                    Strike = true;
                }
            }

            if (f.Outline != null)
            {
                if (f.Outline.Val == null)
                {
                    Outline = true;
                }
                else if (f.Outline.Val.Value)
                {
                    Outline = true;
                }
            }

            if (f.Shadow != null)
            {
                if (f.Shadow.Val == null)
                {
                    Shadow = true;
                }
                else if (f.Shadow.Val.Value)
                {
                    Shadow = true;
                }
            }

            if (f.Condense != null)
            {
                if (f.Condense.Val == null)
                {
                    Condense = true;
                }
                else if (f.Condense.Val.Value)
                {
                    Condense = true;
                }
            }

            if (f.Extend != null)
            {
                if (f.Extend.Val == null)
                {
                    Extend = true;
                }
                else if (f.Extend.Val.Value)
                {
                    Extend = true;
                }
            }

            if (f.Color != null)
            {
                clrFontColor = new SLColor(listThemeColors, listIndexedColors);
                clrFontColor.FromSpreadsheetColor(f.Color);
                HasFontColor = !clrFontColor.IsEmpty();
            }

            if ((f.FontSize != null) && (f.FontSize.Val != null))
            {
                FontSize = f.FontSize.Val.Value;
            }

            if (f.Underline != null)
            {
                if (f.Underline.Val != null)
                {
                    Underline = f.Underline.Val.Value;
                }
                else
                {
                    Underline = UnderlineValues.Single;
                }
            }

            if ((f.VerticalTextAlignment != null) && (f.VerticalTextAlignment.Val != null))
            {
                VerticalAlignment = f.VerticalTextAlignment.Val.Value;
            }

            if ((f.FontScheme != null) && (f.FontScheme.Val != null))
            {
                FontScheme = f.FontScheme.Val.Value;
            }
        }
Пример #5
0
 /// <summary>
 ///     Remove any existing color.
 /// </summary>
 public void RemoveColor()
 {
     clrReal  = new SLColor(listThemeColors, listIndexedColors);
     HasColor = false;
 }