// common open for all allFiles internal override void OpenFileUI() { this.openFileDialog.InitialDirectory = FileSelector.GetFolderForFileSelection(this.FileName); using (new AbandonTopPosition(VideoForm.CurrentForm)) { using (new FilterFileDialog(this.openFileDialog)) { this.openFileDialog.Filter = GlobalOptions.GetFileFilterForVideo(false); this.openFileDialog.Filter += "|" + GlobalOptions.GetFileFilterForSubtitles(false); this.openFileDialog.Filter += "|" + GlobalOptions.GetFileFilterForLesson(false); this.openFileDialog.Filter += "|" + GlobalOptions.GetFileFilterForText(false); this.openFileDialog.Filter += GlobalOptions.Allfiles; if (openFileDialog.ShowDialog() == DialogResult.OK) { CheckAndAssignFileNameFormUI(openFileDialog.FileName); } } } }
// http://download.ted.com/talks/AbigailWashburn_2012-320k.mp4 // C:\Users\siarhei_fedarenka\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.IE5\2SD50S60\AbigailWashburn_2012-320k[1].mp4 void OpenVideoUI() { if (!Utils.IsURL(this.VideoFileName)) { this.openFileDialog.InitialDirectory = FileSelector.GetFolderForFileSelection(this.FileName); } using (new AbandonTopPosition(VideoForm.CurrentForm)) { using (new FilterFileDialog(this.openFileDialog)) { this.openFileDialog.Filter = GlobalOptions.GetFileFilterForVideo(true); if (openFileDialog.ShowDialog() == DialogResult.OK) { this.VideoFileName = openFileDialog.FileName; // TODO: неплохо бы знать валидный ли файл SuggestTextFile(this.VideoFileName); } } } }
void btVideoOpen_Click(object sender, EventArgs e) { GetFileName(GlobalOptions.GetFileFilterForVideo(true), this.txVideoFile); }