public void ImportTussleScript(bool overwrite) { if (overwrite) { fileBrowser.BrowseForFile(FileLoader.FighterDir, OverwriteFromTussleScript); } else { fileBrowser.BrowseForFile(FileLoader.FighterDir, AddFromTussleScript); } fileBrowser.SetErrorText("Error parsing TussleScript"); }
private void OpenFile() { string xmlFile = FileBrowser.BrowseForFile("MWA|*.mwa"); if (string.IsNullOrWhiteSpace(xmlFile)) { return; } OpenFile(xmlFile); }
private void FileBrowser_Click(object sender, RoutedEventArgs e) { TextBox destinationBox = ((sender as Button).Parent as Panel).Children.OfType <TextBox>().FirstOrDefault(); if (destinationBox == null) { (sender as Button).IsEnabled = false; return; } string path = destinationBox.Text; if (FileBrowser.BrowseForFile(ref path, "Find Blender.exe on your PC") == System.Windows.Forms.DialogResult.Cancel) { return; // cancelled } destinationBox.Text = path; }
private void SelectUnits() { string location = FileBrowser.BrowseForFile("Video|*.avi;*.mpg;*.mpeg;*.mp4;*.mov|Image|*.jpg;*.jpeg*.bmp;*.png"); if (string.IsNullOrWhiteSpace(location)) { return; } string ext = Path.GetExtension(location); Bitmap bitmap; if (ext.Contains("avi") || ext.Contains("mpg") || ext.Contains("mpeg") || ext.Contains("mov")) { //Is video file using (IVideo video = ModelResolver.Resolve <IVideo>()) { video.SetVideo(location); using (Image <Bgr, Byte> image = video.GetFrameImage()) { bitmap = new Bitmap(image.Bitmap); } } } else { //Is image file bitmap = new Bitmap(location); } PickUnitsPointsView view = new PickUnitsPointsView(); PickUnitsPointsViewModel viewModel = new PickUnitsPointsViewModel(bitmap); view.DataContext = viewModel; view.ShowDialog(); if (viewModel.ExitResult != WindowExitResult.Ok) { return; } UnitsToMm = viewModel.UnitsToMm; }
private void Browse_Click(object sender, RoutedEventArgs e) { while (true) { string path = GPath.Text; if (FileBrowser.BrowseForFile(ref path, "Find a GLB File") == System.Windows.Forms.DialogResult.Cancel) { break; } if (path.StartsWith(Workspace)) { GPath.Text = path; break; } else { MessageBox.Show("That path is not a child of the Workspace Directory. These files need to be in the workspace directory in order for the game to find them."); } } }