/// <summary> /// Remove an entry from the list /// </summary> private void btnRemove_Click(object sender, EventArgs e) { // make sure an item is selected if (lvSplice.SelectedIndices.Count == 0) { return; } // remove the item entry from the list int position = lvSplice.SelectedIndices[0]; lvSplice.Items.RemoveAt(position); DroppedMovie[] temp = new DroppedMovie[Movies.Length - 1]; // remove the item from the array for (int i = 0; i < position; i++) { temp[i] = Movies[i]; } for (int j = position; j < temp.Length; j++) { temp[j] = Movies[j + 1]; } Movies = temp; }
/// <summary> /// Move a move down one position in the list /// </summary> private void btnMoveDown_Click(object sender, EventArgs e) { if (lvSplice.SelectedIndices.Count > 0 && lvSplice.SelectedIndices[0] < lvSplice.Items.Count - 1) { int position = lvSplice.SelectedIndices[0]; DroppedMovie temp = Movies[position]; Movies[position] = Movies[position + 1]; Movies[position + 1] = temp; updateList(position + 1); } }
/// <summary> /// Move a movie to the end of the list /// </summary> private void btnMoveEnd_Click(object sender, EventArgs e) { if (lvSplice.SelectedIndices.Count > 0 && lvSplice.SelectedIndices[0] < lvSplice.Items.Count - 1) { int position = lvSplice.SelectedIndices[0]; DroppedMovie temp = Movies[position]; for (int i = 0; i < lvSplice.Items.Count - 1; i++) { Movies[i] = Movies[i + 1]; } Movies[lvSplice.Items.Count - 1] = temp; updateList(lvSplice.Items.Count - 1); } }
/// <summary> /// Move a movie to the first position in the list /// </summary> private void btnMoveStart_Click(object sender, EventArgs e) { if (lvSplice.SelectedIndices.Count > 0 && lvSplice.SelectedIndices[0] > 0) { int position = lvSplice.SelectedIndices[0]; DroppedMovie temp = Movies[position]; for (int i = position; i > 0; i--) { Movies[i] = Movies[i - 1]; } Movies[0] = temp; updateList(0); } }
/// <summary> /// Check for a valid TAS file and add it to the DroppedMovie array /// </summary> private DroppedMovie[] populateMovieList(string filename) { MovieType fileType = IsValid(filename); if (fileType != MovieType.None) { DroppedMovie[] temp = new DroppedMovie[Movies.Length + 1]; Movies.CopyTo(temp, 0); temp[Movies.Length].MovieType = fileType; temp[Movies.Length].Movie = LoadMovie(filename, fileType); return(temp); } return(null); }
/// <summary> /// Check for a valid TAS file and add it to the DroppedMovie array /// </summary> private DroppedMovie[] populateMovieList(string filename) { MovieType fileType = IsValid(filename); if (fileType != MovieType.None) { DroppedMovie[] temp = new DroppedMovie[Movies.Length + 1]; Movies.CopyTo(temp, 0); temp[Movies.Length].MovieType = fileType; temp[Movies.Length].Movie = LoadMovie(filename, fileType); return temp; } return null; }
/// <summary> /// Remove an entry from the list /// </summary> private void btnRemove_Click(object sender, EventArgs e) { // make sure an item is selected if (lvSplice.SelectedIndices.Count == 0) return; // remove the item entry from the list int position = lvSplice.SelectedIndices[0]; lvSplice.Items.RemoveAt(position); DroppedMovie[] temp = new DroppedMovie[Movies.Length - 1]; // remove the item from the array for (int i = 0; i < position; i++) temp[i] = Movies[i]; for (int j = position; j < temp.Length; j++) temp[j] = Movies[j + 1]; Movies = temp; }