private void OnRenderToDisk() { var filterBuilder = new FileDialogFilterBuilder(); filterBuilder.Add("GIF Image", "*.gif"); var saveDialog = new SaveFileDialog { AddExtension = true, AutoUpgradeEnabled = true, CheckPathExists = true, DefaultExt = ".gif", Filter = filterBuilder.ToString(), OverwritePrompt = true }; if (!string.IsNullOrEmpty(outputFileName)) { saveDialog.FileName = outputFileName; } var result = saveDialog.ShowDialog(); if (result == DialogResult.Cancel) { return; } outputFileName = saveDialog.FileName; animator.TaskFinished += OnRenderToDiskFinished; RenderImpl(); }
private static string CreateFilter(bool isLoad) { var filterBuilder = new FileDialogFilterBuilder(); filterBuilder.Add("Project Files", string.Format("*{0}", defaultExtension)); if (isLoad) { filterBuilder.Add("Legacy Project Files", "*.gifprj"); filterBuilder.Add("XML Project Files", "*.xml"); filterBuilder.AddAllFiles(); } return(filterBuilder.ToString()); }
private void addFileButton_Click(object sender, EventArgs e) { this.EnsureFilterCreated(); using (OpenFileDialog dialog = new OpenFileDialog { Filter = _filter.ToString(), DefaultExt = "csproj", // TODO: Calculate this based on the filter Title = "Add Project", Multiselect = true }) { if (dialog.ShowDialog(this) == DialogResult.OK) { this.AddFilesToMru(dialog.FileNames); } } }