private void Save() { if (openFile.Name != titleBox.Text) { Library.removeFromLibrary(openFile.Name); } openFile.Name = titleBox.Text; openFile.Byline = bylineBox.Text; openFile.Copyright = copyrightBox.Text; openFile.LinesPerSlide = Decimal.ToInt32(linesPerSlide.Value); openFile.Chorus = -1; openFile.setupTexts(slidePool.Count, slideList.Count); for (int x = 0; x < slidePool.Count; x++) { EditableSlide temp = slidePool[x]; openFile.addText(temp.Index, temp.Text, temp.LinesPerSlide); if (temp.Chorus) { openFile.Chorus = temp.Index; } } for (int x = 0; x < slideList.Count; x++) { PlaceholderSlide temp = slideList[x]; openFile.addOrder(x, temp.Index); } openFile.Write(); Library.addToLibrary(openFile.Name); }
private void reorderDown_Click(object sender, EventArgs e) { bool[] toSelect = new bool[slideList.Count]; for (int x = slideList.Count - 1; x >= 0; x--) { toSelect[x] = false; if (slideOrder.GetSelected(x)) { int index = x; if (index < slideList.Count - 1) { PlaceholderSlide selected = slideList[index]; slideList.RemoveAt(index); slideList.Insert(index + 1, selected); toSelect[index + 1] = true; } else { toSelect[index] = true; } } } checkSaveButton(); refreshLists(); updateSelection(toSelect); }