private void button1_Click(object sender, RoutedEventArgs e) { Microsoft.Win32.OpenFileDialog ofd = new Microsoft.Win32.OpenFileDialog(); ofd.FileName = ""; ofd.Filter = VideoMgr.GetAllowedFiletypesSelector(); if (ofd.ShowDialog() != true) { return; } player.SetMediaFile(ofd.FileName); // TODO player event media changed -> setmediafile, volume, etc. }
private void btnAddFile_Click(object sender, RoutedEventArgs e) { Microsoft.Win32.OpenFileDialog ofd = new Microsoft.Win32.OpenFileDialog(); ofd.Multiselect = true; if (Directory.Exists(Properties.Settings.Default.VideoDir)) { ofd.InitialDirectory = Properties.Settings.Default.VideoDir; } ofd.CheckFileExists = true; ofd.Filter = VideoMgr.GetAllowedFiletypesSelector(); bool?res = ofd.ShowDialog(); if (res.HasValue && res.Value) { Playlist.ActivePlaylist.AddVideos(ofd.FileNames); } }