private void ShowActiveEditor(bool showSplash) { if (SelectedSolutionToggle == null) { return; } if (ActiveSolutionEditor == null) { var newEditor = CreateSolutionEditor(SelectedSolutionToggle.SolutionInfo); SolutionEditors.Add(newEditor); } var activeEditorControl = (Control)ActiveSolutionEditor; if (!pnContent.Controls.Contains(activeEditorControl)) { pnContent.Controls.Add(activeEditorControl); ConfigureSolutionEditor(ActiveSolutionEditor, showSplash); ActiveSolutionEditor.LoadData(); } ActiveSolutionEditor.ShowEditor(showSplash); var rareUsedEditors = SolutionEditors.OrderByDescending(editor => editor.LastToggled).Skip(3).ToList(); foreach (var editor in rareUsedEditors) { var editorControl = (Control)editor; pnContent.Controls.Remove(editorControl); SolutionEditors.Remove(editor); editor.Release(); editorControl.Dispose(); editorControl = null; } }
protected override void UpdateEditedContet() { if (SolutionEditors.Any() && !ContentUpdateInfo.ChangeInfo.WholeScheduleChanged) { return; } SolutionEditors.ForEach(se => se.LoadData()); ShowActiveEditor(false); }
protected override void SaveData() { SolutionEditors.ForEach(se => se.SaveData()); base.SaveData(); }