EditLayoutUserSettings() { AssertValid(); if (oNodeXLControl.IsLayingOutGraph) { return; } LayoutUserSettings oLayoutUserSettings = new LayoutUserSettings(); LayoutUserSettingsDialog oLayoutUserSettingsDialog = new LayoutUserSettingsDialog(oLayoutUserSettings); if (oLayoutUserSettingsDialog.ShowDialog() == DialogResult.OK) { oLayoutUserSettings.Save(); ApplyLayoutUserSettings(oLayoutUserSettings); oNodeXLControl.DrawGraph(); } }
OnLayoutChanged ( LayoutType eLayout ) { AssertValid(); if (m_bHandlingLayoutChanged) { // Prevent an endless loop when the layout managers are // synchronized. return; } m_bHandlingLayoutChanged = true; // Synchronize the layout managers. m_oRibbon.Layout = m_oLayoutManagerForToolStripSplitButton.Layout = m_oLayoutManagerForContextMenu.Layout = eLayout; // Save and apply the new layout. LayoutUserSettings oLayoutUserSettings = new LayoutUserSettings(); oLayoutUserSettings.Layout = eLayout; oLayoutUserSettings.Save(); ApplyLayoutUserSettings(oLayoutUserSettings); // If the layout was just changed from Null to something else and the // X and Y columns were autofilled, the X and Y autofill results need // to be cleared. if (!this.LayoutIsNull) { PerWorkbookSettings oPerWorkbookSettings = this.PerWorkbookSettings; AutoFillWorkbookResults oAutoFillWorkbookResults = oPerWorkbookSettings.AutoFillWorkbookResults; if (oAutoFillWorkbookResults.VertexXResults.ColumnAutoFilled) { oAutoFillWorkbookResults.VertexXResults = new AutoFillNumericRangeColumnResults(); oAutoFillWorkbookResults.VertexYResults = new AutoFillNumericRangeColumnResults(); // The PerWorkbookSettings object doesn't persist its settings // to the workbook unless one of its own properties is set. oPerWorkbookSettings.AutoFillWorkbookResults = oAutoFillWorkbookResults; UpdateAxes(oPerWorkbookSettings); } } m_bHandlingLayoutChanged = false; }
OnLayoutChanged ( LayoutType eLayout ) { AssertValid(); if (m_bHandlingLayoutChanged) { // Prevent an endless loop when the layout managers are // synchronized. return; } m_bHandlingLayoutChanged = true; // Save and apply the new layout. LayoutUserSettings oLayoutUserSettings = new LayoutUserSettings(); oLayoutUserSettings.NotUseWorkbookSettings(); oLayoutUserSettings.Layout = eLayout; oLayoutUserSettings.Save(); ApplyLayoutUserSettings(oLayoutUserSettings); // If the layout was just changed from Null to something else and the // X and Y columns were autofilled, the X and Y autofill results need // to be cleared. m_bHandlingLayoutChanged = false; }