public RTCell(XmlNode parent) { XmlElement ele = (XmlElement)parent; if (ele.HasAttribute("value")) { this.value = parent.Attributes["value"].Value; } if (parent.HasChildNodes && this.value == null) { value = parent.FirstChild.Value; } if (ele.HasAttribute("format")) { this.cellFormatType = (CellFormatType)int.Parse(parent.Attributes["format"].Value); this.cellFormatString = CellFormat.GetFormatString(this.cellFormatType); } if (ele.HasAttribute("bgcolor")) { try { this.backgroundColorString = parent.Attributes["bgcolor"].Value.TrimStart('#'); this.backgroundColor = ColorTranslator.FromHtml("#" + this.backgroundColorString); } catch { this.backgroundColorString = null; } } }