示例#1
0
        private void BrowseMovies_Click(object sender, EventArgs e)
        {
            var ofd = new OpenFileDialog
            {
                Filter = "Movie Files (*." + MovieService.DefaultExtension + ")|*." + MovieService.DefaultExtension +
                         "|TAS project Files (*." + TasMovie.Extension + ")|*." + TasMovie.Extension +
                         "|All Files|*.*",
                InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.PathEntries.MoviesPathFragment, null)
            };

            var result = ofd.ShowDialog();

            if (result == DialogResult.OK)
            {
                var file = new FileInfo(ofd.FileName);
                if (!file.Exists)
                {
                    return;
                }

                int?index = AddMovieToList(ofd.FileName, true);
                RefreshMovieList();
                if (index.HasValue)
                {
                    MovieView.SelectedIndices.Clear();
                    MovieView.setSelection(index.Value);
                    MovieView.SelectItem(index.Value, true);
                }
            }
        }
示例#2
0
 private void HighlightMovie(int index)
 {
     MovieView.SelectedIndices.Clear();
     MovieView.setSelection(index);
     MovieView.SelectItem(index, true);
 }