/// <summary> /// Initializes a new instance of the <see cref="SetOpenXmlParagraphNumerationForm"/> class. /// </summary> /// <param name="documentVisualEditor">The Office document visual editor.</param> public SetOpenXmlParagraphNumerationForm(OfficeDocumentVisualEditor documentVisualEditor) : this() { _documentVisualEditor = documentVisualEditor; _documentEditor = documentVisualEditor.CreateDocumentEditor(); UpdateUI(); }
/// <summary> /// Handles the Interaction event of the OfficeDocumentInteractionController. /// </summary> private void _officeDocumentInteractionController_Interaction(object sender, InteractionEventArgs e) { // if mouse is double clicked if (e.MouseClickCount == 2) { // find visual editor OfficeDocumentVisualEditor visualEditor = CompositeInteractionController.FindInteractionController <OfficeDocumentVisualEditor>(e.InteractionController); // if visual editor is found and has charts if (visualEditor != null && visualEditor.HasCharts) { // create document editor using (DocxDocumentEditor editor = visualEditor.CreateDocumentEditor()) { // if document has chart(s) and don't have text if (editor.Charts.Length > 0 && string.IsNullOrEmpty(editor.Body.Text.Trim('\n'))) { // open chart editor form ShowChartForm(visualEditor); e.InteractionOccured(false); } } } } }