コード例 #1
0
ファイル: ExcelDxfStyle.cs プロジェクト: yosmanyhs/EPPlus-1
        private ExcelDxfColor GetColor(XmlHelperInstance helper, string path)
        {
            ExcelDxfColor ret = new ExcelDxfColor(_styles);

            ret.Theme = (eThemeSchemeColor?)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.Replace("#", ""), NumberStyles.HexNumber));
            }
            ret.Auto = helper.GetXmlNodeBoolNullable(path + "/@auto");
            ret.Tint = helper.GetXmlNodeDoubleNull(path + "/@tint");
            return(ret);
        }
コード例 #2
0
ファイル: ExcelDxfStyle.cs プロジェクト: zw2430/EPPlus
        private ExcelDxfColor GetColor(XmlHelperInstance helper, string path)
        {
            ExcelDxfColor ret = new ExcelDxfColor(_styles);

            ret.Theme = helper.GetXmlNodeIntNull(path + "/@theme");
            ret.Index = helper.GetXmlNodeIntNull(path + "/@index");
            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);
        }