/// <summary> /// Edits the document layout settings using DocumentLayoutSettingsDialog. /// </summary> public void EditLayoutSettingsUseDialog() { // create dialog with necessary layout settings using (DocumentLayoutSettingsDialog dialog = CreateLayoutSettingsDialog()) { // pass current layout settings to the dialog if (LayoutSettings != null) { dialog.LayoutSettings = (DocumentLayoutSettings)LayoutSettings.Clone(); } if (dialog.ShowDialog() == DialogResult.OK) { // get layout settings from dialog try { LayoutSettings = dialog.LayoutSettings; } catch (Exception ex) { DemosTools.ShowErrorMessage(ex); } } } }
/// <summary> /// Handles the Click event of OkButton object. /// </summary> private void okButton_Click(object sender, EventArgs e) { // if default settings must be used if (defaultSettingsCheckBox.Checked) { // create default settings LayoutSettings = CreateDefaultLayoutSettings(); } // if custom settings must be used else { // get settings from control base.LayoutSettings = documentLayoutSettingsEditorControl1.LayoutSettings; #if !REMOVE_OFFICE_PLUGIN ((DocxDocumentLayoutSettings)LayoutSettings).ShowHiddenContent = showHiddenContentCheckBox.Checked; #endif } DialogResult = DialogResult.OK; }
/// <summary> /// Handles the Click event of OkButton object. /// </summary> private void okButton_Click(object sender, EventArgs e) { if (defaultSettingsCheckBox.Checked) { // create default settings LayoutSettings = CreateDefaultLayoutSettings(); } else { // get settings base.LayoutSettings = documentLayoutSettingsEditorControl1.LayoutSettings; #if !REMOVE_OFFICE_PLUGIN XlsxDocumentLayoutSettings xlsxSettings = (XlsxDocumentLayoutSettings)LayoutSettings; xlsxSettings.PageLayoutSettingsType = xlsxPageLayoutSettingsTypeControl1.Settings; xlsxSettings.ShowHiddenSheets = showHiddenSheetsCheckBox.Checked; xlsxSettings.ShowHiddenGraphics = showHiddenGraphicsCheckBox.Checked; #endif } DialogResult = DialogResult.OK; }