Esempio n. 1
0
 protected void SetValueColor(XmlHelper helper, string path, ExcelDxfColor color)
 {
     if (color != null && color.HasValue)
     {
         if (color.Color != null)
         {
             SetValue(helper, path + "/@rgb", color.Color.Value.ToArgb().ToString("x"));
         }
         else if (color.Auto != null)
         {
             SetValueBool(helper, path + "/@auto", color.Auto);
         }
         else if (color.Theme != null)
         {
             SetValue(helper, path + "/@theme", color.Theme);
         }
         else if (color.Index != null)
         {
             SetValue(helper, path + "/@indexed", color.Index);
         }
         if (color.Tint != null)
         {
             SetValue(helper, path + "/@tint", color.Tint);
         }
     }
 }
Esempio n. 2
0
        private ExcelDxfColor GetColor(XmlHelperInstance helper, string path)
        {
            ExcelDxfColor ret = new ExcelDxfColor(_styles);

            ret.Theme = helper.GetXmlNodeIntNull(path + "/@theme");
            ret.Index = helper.GetXmlNodeIntNull(path + "/@indexed");
            string rgb = helper.GetXmlNodeString(path + "/@rgb");

            if (rgb != "")
            {
                ret.Color = Color.FromArgb(int.Parse(rgb.Substring(0, 2), System.Globalization.NumberStyles.AllowHexSpecifier),
                                           int.Parse(rgb.Substring(2, 2), System.Globalization.NumberStyles.AllowHexSpecifier),
                                           int.Parse(rgb.Substring(4, 2), System.Globalization.NumberStyles.AllowHexSpecifier),
                                           int.Parse(rgb.Substring(6, 2), System.Globalization.NumberStyles.AllowHexSpecifier));
            }
            ret.Auto = helper.GetXmlNodeBoolNullable(path + "/@auto");
            ret.Tint = helper.GetXmlNodeDoubleNull(path + "/@tint");
            return(ret);
        }
Esempio n. 3
0
 internal ExcelDxfBorderItem(ExcelStyles styles) :
     base(styles)
 {
     Color = new ExcelDxfColor(styles);
 }
Esempio n. 4
0
 public ExcelDxfFill(ExcelStyles styles)
     : base(styles)
 {
     PatternColor    = new ExcelDxfColor(styles);
     BackgroundColor = new ExcelDxfColor(styles);
 }
Esempio n. 5
0
 public ExcelDxfFontBase(ExcelStyles styles)
     : base(styles)
 {
     Color = new ExcelDxfColor(styles);
 }