protected override void Dispose(bool disposeManagedResources)
        {
            if (!_disposed)
            {
                if (disposeManagedResources)
                {
                    if (_cellIsEditable)
                    {
                        TableEditingContext.RemoveCellBehavior(this);
                    }
                }

                _disposed = true;
            }

            base.Dispose(disposeManagedResources);
        }
        public TableColumnSizeEditor(IHTMLTable table, IHtmlEditorComponentContext editorContext, IHTMLPaintSiteRaw paintSite)
        {
            Debug.Assert(((IHTMLElement)table).offsetHeight > 0 && ((IHTMLElement)table).offsetWidth > 0,
                         "TableColumnSizeEditor unexpectedly attached to a table with no height and/or width!");

            // save references
            _table = table;
            _editorContext = editorContext;
            _paintSite = paintSite;

            // initialize sizing
            _sizingOperation = new SizingOperation(_editorContext, _table);

            // initialize table editing context
            _tableEditingContext = new TableEditingContext(editorContext);

            // subscribe to events
            _editorContext.PreHandleEvent += new OpenLiveWriter.Mshtml.HtmlEditDesignerEventHandler(_editorContext_PreHandleEvent);
        }
Beispiel #3
0
        public TableColumnSizeEditor(IHTMLTable table, IHtmlEditorComponentContext editorContext, IHTMLPaintSiteRaw paintSite)
        {
            Debug.Assert(((IHTMLElement)table).offsetHeight > 0 && ((IHTMLElement)table).offsetWidth > 0,
                         "TableColumnSizeEditor unexpectedly attached to a table with no height and/or width!");

            // save references
            _table         = table;
            _editorContext = editorContext;
            _paintSite     = paintSite;

            // initialize sizing
            _sizingOperation = new SizingOperation(_editorContext, _table);

            // initialize table editing context
            _tableEditingContext = new TableEditingContext(editorContext);

            // subscribe to events
            _editorContext.PreHandleEvent += new OpenLiveWriter.Mshtml.HtmlEditDesignerEventHandler(_editorContext_PreHandleEvent);
        }
        protected override void OnElementAttached()
        {
            // call base
            base.OnElementAttached();

            // determine whether the cell is editable
            _cellIsEditable = TableHelper.TableElementIsEditable(HTMLElement, ElementRange);

            // if editable then do our thing
            if (_cellIsEditable)
            {
                // add ourselves to the list of cell element behaviors
                TableEditingContext.AddCellBehavior(this);

                // if the table has no borders then set a runtime style that lets the user see the borders
                TableHelper.UpdateDesignTimeBorders(
                    TableHelper.GetContainingTableElement(HTMLElement),
                    HTMLElement as IHTMLElement2);
            }
        }
Beispiel #5
0
 public TableCellSelectionTracker(TableEditingElementBehavior tableElementBehavior, TableEditingContext tableEditingContext)
 {
     _tableElementBehavior = tableElementBehavior;
     _tableEditingContext  = tableEditingContext;
 }
 public TableCellSelectionTracker(TableEditingElementBehavior tableElementBehavior, TableEditingContext tableEditingContext)
 {
     _tableElementBehavior = tableElementBehavior;
     _tableEditingContext = tableEditingContext;
 }