private void commandTableProperties_Execute(object sender, EventArgs e) { using (TablePropertiesForm tablePropertiesForm = new TablePropertiesForm()) { // read existing properties TableProperties existingProperties = TableEditor.GetTableProperties(_editorContext); // show the dialog TableProperties editedProperties = tablePropertiesForm.EditTable(_editorContext.MainFrameWindow, existingProperties); // update if (editedProperties != null) { TableEditor.SetTableProperties(_editorContext, editedProperties); } } }
private void commandInsertTable_Execute(object sender, EventArgs e) { //Insert gestures are only supported in the body, so force focus to the body FocusBody(); using (TablePropertiesForm tableForm = new TablePropertiesForm()) { // show the dialog TableCreationParameters tableCreationParameters = tableForm.CreateTable(_mainFrameWindow); // insert if (tableCreationParameters != null) { using (new WaitCursor()) { // fixup bizzaro table selections IHtmlEditorComponentContext editorContext = _currentEditor as IHtmlEditorComponentContext; if (editorContext != null) { // check for a discontigous selection of cells within an existing table and // "fix" the selection accordingly so the editor doesn't barf on it TableSelection tableSelection = new TableSelection(editorContext.Selection.SelectedMarkupRange); if (tableSelection.HasContiguousSelection && !tableSelection.EntireTableSelected) { TableEditor.SelectCell(editorContext, tableSelection.BeginCell); } } // insert the table TableEditor.InsertTable(_currentEditor, editorContext, tableCreationParameters); } } // focus the editor so we see the cursor in the first cell _currentEditor.Focus(); } }
private void commandTableProperties_Execute(object sender, EventArgs e) { using (TablePropertiesForm tablePropertiesForm = new TablePropertiesForm()) { // read existing properites TableProperties existingProperties = TableEditor.GetTableProperties(_editorContext); // show the dialog TableProperties editedProperties = tablePropertiesForm.EditTable(_editorContext.MainFrameWindow, existingProperties); // update if (editedProperties != null) { TableEditor.SetTableProperties(_editorContext, editedProperties); } } }