Пример #1
0
        public bool Set(MSHTML.IHTMLTableCell cell)
        {
            // if user has selected a table extract those properties
            if (cell == null)
            {
                return(false);
            }

            try
            {
                base.Set((object)cell.bgColor, (object)cell.borderColor);

                if (cell.align != null)
                {
                    this.HorzAlignment = (HorizontalAlignOption)Utils.TryParseEnum(typeof(HorizontalAlignOption), cell.align, HorizontalAlignOption.Default);
                }

                if (cell.vAlign != null)
                {
                    this.VertAlignment = (VerticalAlignOption)Utils.TryParseEnum(typeof(VerticalAlignOption), cell.vAlign, VerticalAlignOption.Default);
                }

                this.ColSpan = cell.colSpan;
                this.RowSpan = cell.rowSpan;
                this.NoWrap  = cell.noWrap;
            }
            catch (Exception ex)
            {
                // throw an exception indicating table structure change be determined
                throw new HtmlEditorException("Unable to determine Html Cell properties.", "GetCellProperties", ex);
            }

            return(true);
        }
Пример #2
0
        public bool Get(ref MSHTML.IHTMLTableCell cell)
        {
            if (cell == null)
            {
                return(false);
            }

            object bgColor, borderColor;

            base.Get(out bgColor, out borderColor);

            cell.bgColor     = bgColor;
            cell.borderColor = borderColor;

            if (this.HorzAlignment == HorizontalAlignOption.Default)
            {
                cell.align = null;
            }
            else
            {
                cell.align = this.HorzAlignment.ToString().ToLower();
            }

            if (this.VertAlignment == VerticalAlignOption.Default)
            {
                cell.vAlign = null;
            }
            else
            {
                cell.vAlign = this.VertAlignment.ToString().ToLower();
            }

            cell.colSpan = this.ColSpan;
            cell.rowSpan = this.RowSpan;
            cell.noWrap  = this.NoWrap;

            return(true);
        }
Пример #3
0
 public HtmlTableCellProperty(MSHTML.IHTMLTableCell cell) : this()
 {
     Set(cell);
 }