private void chorusButton_Click(object sender, EventArgs e) { EditableSlide temp = slidePool[availableSlides.SelectedIndex]; slidePool.RemoveAt(availableSlides.SelectedIndex); temp.Chorus = true; for (int x = 0; x < slideList.Count; x++) { slideList[x].SongHasChorus = true; if (slideList[x].Index == temp.Index) { slideList[x].Index = 0; slideList[x].Chorus = true; } else if (slideList[x].Index < temp.Index) { slideList[x].Index++; } } temp.Index = 0; slidePool.Insert(0, temp); for (int x = 0; x < slidePool.Count; x++) { slidePool[x].Index = x; slidePool[x].SongHasChorus = true; } refreshLists(); availableSlides.SelectedIndex = 0; chorusindex = temp.Index; chorusButton.Enabled = false; checkSaveButton(); }
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 addSlides_Click(object sender, EventArgs e) { if (availableSlides.SelectedIndex < 0) { return; } EditableSlide temp = slidePool[availableSlides.SelectedIndex]; slideList.Add(new PlaceholderSlide(temp.Index, temp.Chorus, (chorusindex != -1))); checkSaveButton(); refreshLists(); updateSlideOrderButtons(); }