private void btnEffects_Click(object sender, RoutedEventArgs e) { OpenFileDialog f = new OpenFileDialog { Multiselect = true, Filter = " Portable Network Graphics Audio Video Interleave (*.png;*avi)|*.png;*.avi|All files (*.*)|*.*",//Aegisub Advanced Subtitle InitialDirectory = Paths.LastPathUse }; if (f.ShowDialog() == true) { Paths.LastPathUse = GetDirectoryName(f.FileNames[0]); string FileNameNoPath; foreach (string filename in f.FileNames) { FileNameNoPath = System.IO.Path.GetFileName(filename); lbEffects.Items.Add(FileNameNoPath); Builder.AddEffect(filename); //Frames w = new Frames(); FileNameNoPath = Path.GetFileNameWithoutExtension(FileNameNoPath); if (FileNameNoPath.IndexOf('_') != -1) { FileNameNoPath = FileNameNoPath.Split('_')[1]; } if (FileNameNoPath.IndexOf("-") == -1) { Tuple <string, string> a; do { a = Frames.GetFrames(System.IO.Path.GetFileName(filename)); }while (a == null); Builder.EffectsFrames.Add(a); } else { Builder.EffectsFrames.Add(new Tuple <string, string>(FileNameNoPath.Split('-')[0], FileNameNoPath.Split('-')[1])); } } } }
public static Tuple <string, string> GetFrames(string File) { Frames window = new Frames(File); window.ShowDialog(); if (window.CheckFrames()) { Tuple <string, string> ok = new Tuple <string, string> ( window.txtFStart.Text, window.txtFEnd.Text ); return(ok); } else { return(null); } }