public bool Set(MSHTML.IHTMLTableRow row) { // if user has selected a table extract those properties if (row == null) { return(false); } try { base.Set((object)row.bgColor, (object)row.borderColor); if (row.align != null) { this.HorzAlignment = (HorizontalAlignOption)Utils.TryParseEnum(typeof(HorizontalAlignOption), row.align, HorizontalAlignOption.Default); } if (row.vAlign != null) { this.VertAlignment = (VerticalAlignOption)Utils.TryParseEnum(typeof(VerticalAlignOption), row.vAlign, VerticalAlignOption.Default); } if (row.bgColor != null) { this.BackColor = ColorTranslator.FromHtml(row.bgColor.ToString()); } } catch (Exception ex) { // throw an exception indicating table structure change be determined throw new HtmlEditorException("Unable to determine Html Row properties.", "GetRowProperties", ex); } return(true); }
public bool Get(ref MSHTML.IHTMLTableRow row) { if (row == null) { return(false); } object bgColor, borderColor; base.Get(out bgColor, out borderColor); row.bgColor = bgColor; row.borderColor = borderColor; if (this.HorzAlignment == HorizontalAlignOption.Default) { row.align = null; } else { row.align = this.HorzAlignment.ToString().ToLower(); } if (this.VertAlignment == VerticalAlignOption.Default) { row.vAlign = null; } else { row.vAlign = this.VertAlignment.ToString().ToLower(); } return(true); }
public HtmlTableRowProperty(MSHTML.IHTMLTableRow row) : this() { Set(row); }