private void btnDeletePage_Click(object sender, EventArgs e) { if (doc.Pages.Count <= 1) { Dialogues.MsgBox.ShowOk("Action.cantDelLast"); } else { if (Dialogues.MsgBox.ShowYesNo("Action.delPage?")) { int currentInd = -1; for (int i = 0; i < doc.Pages.Count; i++) { if (doc.Pages[i] == inkControl1.Page) { currentInd = i; break; } } if (currentInd >= 0) { KPage page = doc.Pages[currentInd]; doc.Pages.RemoveAt(currentInd); page.Dispose(); currentInd--; if (currentInd < 0) { currentInd = 0; } inkControl1.LoadPage(doc.Pages[currentInd]); } } } }
public void RemovePage(KPage page) { Pages.Remove(page); page.Dispose(); }