private void FillDGV2Row(int iRow, CCurveFont nCurF) { dGV2.Rows[iRow].Cells[0].Value = nCurF.Desc; dGV2.Rows[iRow].Cells[1].Value = nCurF.sFont; dGV2.Rows[iRow].Cells[1].Style.Font = nCurF.nFont; dGV2.Rows[iRow].Cells[1].Style.BackColor = nCurF.FillColor; dGV2.Rows[iRow].Cells[1].Style.ForeColor = nCurF.FontColor; dGV2.Rows[iRow].Cells[2].Value = nCurF.IsFillVisible; dGV2.Rows[iRow].Cells[3].Value = nCurF.sFillColor; dGV2.Rows[iRow].Cells[3].Style.BackColor = nCurF.FillColor; dGV2.Rows[iRow].Cells[3].Style.ForeColor = nCurF.FontColor; dGV2.Rows[iRow].Cells[4].Value = nCurF.IsScaled; }
public void LoadFontFromXML(XmlElement CBaseNode) { if (CBaseNode != null) { FontConverter fc = new FontConverter(); CCurveFont spec = new CCurveFont(); spec.nFont = new Font("宋体", 11); string sName = CBaseNode.GetAttribute("Name"); try { spec.nFont = (Font)fc.ConvertFromString(CBaseNode.GetAttribute("Font")); } catch (Exception) { } spec.Name = sName; spec.Desc = CBaseNode.GetAttribute("Desc"); spec.FontColor = ColorTranslator.FromHtml(CBaseNode.GetAttribute("FontColor")); spec.FillColor = ColorTranslator.FromHtml(CBaseNode.GetAttribute("FillColor")); spec.IsScaled = Convert.ToBoolean(CBaseNode.GetAttribute("IsScaled")); spec.IsFillVisible = Convert.ToBoolean(CBaseNode.GetAttribute("IsFillVisible")); ListCurF.Add(sName, spec); } }