public void RemoveLastAddedTemplate() { for (int i = sheets.Count - 1; i >= 0; i--) { BaseSheet sheet = sheets[i]; if (sheet is IntroductionSheet) { sheets.RemoveAt(i); break; } sheets.RemoveAt(i); } }
private void AddSheet(BaseSheet sheet) { sheets.Add(sheet); sheet.Dock = DockStyle.Fill; if (sheets.Count > 1) { sheet.Visible = false; } else { currentSheetIndex = 0; backButton.Enabled = false; } contentPanel.Controls.Add(sheet); }