private void SaveConfigToolStripMenuItem_Click(object sender, EventArgs e) { try { if (SaveDialog.ShowDialog(this) != DialogResult.OK) { return; } var filename = SaveDialog.FileName; if (!filename.ToLower().EndsWith(".ini")) { filename += ".ini"; } SaveConfig(filename); } catch (Exception ex) { MessageBox.Show(this, ex.ToString(), "Error: Can not save config.", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void ExtractFiles(object sender, FilesEventArgs e) { if (SaveDialog.ShowDialog() == DialogResult.OK) { ExHelper.DecryptModels = settings.DecryptModels; ExHelper.ExtractPath = SaveDialog.SelectedPath; using (Status status = new Status(new Predicate <NexonArchiveFileEntry>(ExHelper.Extract), e.File)) { status.Text = "Extracting files..."; status.DestinationPath = ExHelper.ExtractPath; DialogResult dr = status.ShowDialog(this); if (dr == DialogResult.Abort) { MessageBox.Show("An Error Occured While Extracting The Files...", "Error"); } else if (dr == DialogResult.OK) { MessageBox.Show("All The Selected Files Have Been Extracted Successfully.", "Complete"); } } } }
private void ButtonGenerate_Click(object sender, EventArgs e) { if (SaveDialog.ShowDialog() != DialogResult.OK) { return; } string path = SaveDialog.FileName, template = "template"; int w, h; if (CharTemplateCheck.Checked) { string filename = System.IO.Path.GetFileName(path); path = path.Replace(filename, "!$" + filename); template += "-one-char"; w = Resizer.charWidth * multiplierFactor; h = Resizer.charHeight * multiplierFactor; } else { w = Resizer.charsetWidth * multiplierFactor; h = Resizer.charsetHeight * multiplierFactor; } Resizer.ApplyMultiplierFactor(w, h, template).Save(path); }
private void XAML_NavigationView_ItemInvoked(NavigationView sender, NavigationViewItemInvokedEventArgs args) { if (args.IsSettingsInvoked) { XAML_ContentFrame.Navigate(typeof(SettingsPage), null); } else { var navItem = (DSANavItem)((NavigationViewItem)sender.SelectedItem).Tag; var lastItem = navHistory.LastOrDefault(); if (navItem.NavType == typeof(SavePage)) { Game.CharakterSave(out DSAError error); SaveDialog.ShowDialog(error); XAML_NavigationView.SelectedItem = startItem; if (lastItem.NavType != typeof(HeroLetterPage)) { XAML_ContentFrame.Navigate(typeof(HeroLetterPage)); } } else if (lastItem.NavType != navItem.NavType || lastItem.Parameter != navItem.Parameter) { XAML_ContentFrame.Navigate(navItem.NavType, navItem.Parameter); } } }
private void Button_Save_Configuration_Click(object sender, RoutedEventArgs e) { SaveDialog dialog = new SaveDialog(); dialog.ShowDialog(); string SaveName = dialog.TextBox_Save_Name.Text; if (!string.IsNullOrEmpty(SaveName)) { SaveConfigModel model = new SaveConfigModel() { Name = SaveName, Address = TextBox_IP.Text, Username = TextBox_Username.Text, Password = TextBox_Password.Text, CurrentConnectorType = ComboBox_SqlType.SelectedItem.ToString(), }; Saves.Add(model); var result = JsonMethod <SaveConfigModel> .AddData(Saves); JsonMethod <SaveConfigModel> .WriteDataJson(Path, result); UpdateComboBox_Saves(Saves); } }
private void MISaveAs_Click(object sender, EventArgs e) { if (SaveDialog.ShowDialog() == DialogResult.OK) { Modeller.Save(SaveDialog.FileName); } }
private void buttonSaveToXML_Click(object sender, EventArgs e) { if (SaveDialog.ShowDialog() == DialogResult.OK) { _sqlContext.MetadataContainer.ExportToXML(SaveDialog.FileName); } }
void OnFileViewAddNew(object sender, EventArgs e) { if (SaveDialog.ShowDialog(this) == DialogResult.OK) { FileAdd(OpenDialog.FileNames, true); } }
/// <summary> /// When the select csv is pressed /// </summary> /// <param name="sender">Event sender</param> /// <param name="e">Event arg</param> private void SelectCsvBtn_Click(object sender, EventArgs e) { // change initial directory SaveDialog.InitialDirectory = LastPath; SaveDialog.FileName = CsvName.Text; if (SaveDialog.ShowDialog() == DialogResult.OK) { CsvName.Text = SaveDialog.FileName; InitProgressBar(); ExportLab.Text = "Exportation de la base de données en cours..."; ExportLab.Visible = true; if (FileControl.ExportFile(CsvName.Text, ExportProgress)) { MessageBoxes.DispInfo("L'export est terminé"); this.Close(); } else { MessageBoxes.DispError("Une erreur est survenue lors de l'exportation"); ExportLab.Text = "L'opération a été intérompu, veuillez réessayer"; } // save the path LastPath = SaveDialog.FileName; SaveLastPath(); } }
private void MenuSongsExportRawkSD_Click(object sender, EventArgs e) { SaveDialog.Title = "Save RawkSD Archive"; SaveDialog.Filter = "RawkSD Archive (*.rwk)|*.rwk|All Files|*"; if (SaveDialog.ShowDialog(this) == DialogResult.Cancel) { return; } IList <FormatData> songs = GetSelectedSongData(); bool audio = false; foreach (FormatData song in songs) { if (song.GetFormatAny(FormatType.Audio) != null) { audio = true; break; } } if (audio) { if (MessageBox.Show(this, "Would you like to include audio in your custom package?\nYou may only include audio with your charts if you have permission from the artist to distribute it.", "Include Audio?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { audio = false; } } Exports.ExportRWK(SaveDialog.FileName, songs, audio); }
private void OnButtonSaveClick(Object sender, EventArgs args) { try { SaveDialog dialog = new SaveDialog { Folder = this.settings.TargetSettings.Folder, Overwrite = this.settings.TargetSettings.Overwrite }; if (dialog.ShowDialog(this) != DialogResult.OK) { return; } foreach (CodeTabPage current in this.tbcCode.TabPages.OfType <CodeTabPage>()) { current.Save(dialog.Folder, dialog.Overwrite); } this.settings.TargetSettings.Folder = dialog.Folder; this.settings.TargetSettings.Overwrite = dialog.Overwrite; } catch (Exception exception) { this.ShowError(exception); } }
private void ChooseXLSXToolStripMenuItem_Click(object sender, EventArgs e) { if (SaveDialog.ShowDialog(this) != DialogResult.OK) { return; } XLSXTextBox.Text = SaveDialog.FileName; }
private void SaveButton_Click(object sender, EventArgs e) { if (SaveDialog.ShowDialog() == DialogResult.OK) { string fileName = SaveDialog.FileName; SaveFileDialog(fileName); } }
private void SaveFileBtn_Click(object sender, EventArgs e) { if (SaveDialog.ShowDialog() == DialogResult.OK) { this.SetSettings(); Savior.SaveToFile(settings, SaveDialog.FileName); } }
private void FileDialog_Click(object sender, EventArgs e) { SaveDialog.Filter = "*.xlsx|*.xlsx"; if (SaveDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { FileText.Text = SaveDialog.FileName; } }
private void btnSaveLocally_Click(object sender, EventArgs e) { SaveDialog.FileName = $"Error_{DateTime.Now.ToString("yyyyMMdd")}.error"; if (SaveDialog.ShowDialog() == DialogResult.OK) { File.WriteAllText(SaveDialog.FileName, Error.ToXmlString(), Encoding.ASCII); } }
private void SaveToFile(object sender, EventArgs e) { if (SaveDialog.ShowDialog() == DialogResult.OK) { TextBox.SaveFile(SaveDialog.OpenFile(), RichTextBoxStreamType.PlainText); SetStatus(Resources.Statuses.LogSaved + SaveDialog.FileName); } }
/// <summary> /// Handles save button click. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void savePhaseToolStripMenuItem_Click(object sender, MouseEventArgs e) { if (SaveDialog.ShowDialog() == DialogResult.OK) { PhaseFileIO(SaveDialog.FileName, true); MessageBox.Show("File saved."); } }
private void btnDiag_Click(object sender, EventArgs e) { if (cmbOpcion.Text.Substring(0, 1).ToString() == "1") { //SaveFileDialog saveFileDialog = new SaveFileDialog(); Object RutaDir = Convert.ToString(Environment.CurrentDirectory); SaveDialog.Filter = "ANJU (*.bak)|*.bak"; SaveDialog.Title = "Respaldos"; SaveDialog.ShowDialog(); if (SaveDialog.FileName != "") { try { string Extfile = (SaveDialog.FileName.Substring(SaveDialog.FileName.Length - 3, 3)); switch (Extfile.ToUpper()) { case "BAK": txtPhat.Text = SaveDialog.FileName.ToString(); btnRestaurar.Enabled = false; btnRespaldar.Enabled = true; break; } } catch (Exception Ex) { throw new Exception(Ex.Message, Ex.InnerException); } } } if (cmbOpcion.Text.Substring(0, 1).ToString() == "2") { //SaveFileDialog saveFileDialog = new SaveFileDialog(); Object RutaDir = Convert.ToString(Environment.CurrentDirectory); OpenDialog.Filter = "ANJU (*.bak)|*.bak"; OpenDialog.Title = "Respaldos"; OpenDialog.ShowDialog(); if (OpenDialog.FileName != "") { try { string Extfile = (OpenDialog.FileName.Substring(OpenDialog.FileName.Length - 3, 3)); switch (Extfile.ToUpper()) { case "BAK": txtPhat.Text = OpenDialog.FileName.ToString(); btnRespaldar.Enabled = false; btnRestaurar.Enabled = true; break; } } catch (Exception Ex) { throw new Exception(Ex.Message, Ex.InnerException); } } } }
private void saveAsPNGToolStripMenuItem_Click(object sender, EventArgs e) { SaveDialog.DefaultExt = "png"; SaveDialog.Filter = @"PNG Files|*.png"; SaveDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); if (SaveDialog.ShowDialog() == DialogResult.OK) { chart.SaveImage(SaveDialog.FileName, ChartImageFormat.Png); } }
void Application_BeforeDocumentClose(Word.Document doc, ref bool cancel) { var documentCustomProps = new DocumentCustomProperties(doc); Application.DocumentChange -= Application_DocumentChange_UpdateRibbon; if (documentCustomProps.ArticleNumber.IsNullOrEmpty()) { // If this isn't an elsevier article, default to the normal process return; } if (!doc.Saved) { var dialog = new SaveDialog(); dialog.ShowDialog(); switch (dialog.SelectedChoice) { case SaveDialog.SaveChoice.SaveToSitecoreAndUnlock: // at this point, there can be no metadata changes, only body text changes. var _sitecoreClient = new SitecoreClient(); var errors = _sitecoreClient.SaveArticle(doc, SitecoreClient.ForceReadArticleDetails(documentCustomProps.ArticleNumber), Guid.Empty, new List <StaffStruct>(), documentCustomProps.ArticleNumber); if (errors.Count > 0) { MessageBox.Show (@"There was an error saving the document to Sitecore. Please try again." + Environment.NewLine + Environment.NewLine + @"If the problem persists, contact your system administrator.", @"Informa", MessageBoxButtons.OK, MessageBoxIcon.Error); cancel = true; } else { doc.Saved = true; SitecoreClient.CheckInArticle(documentCustomProps.ArticleNumber); } break; case SaveDialog.SaveChoice.SaveLocal: doc.Save(); break; case SaveDialog.SaveChoice.Cancel: cancel = true; break; case SaveDialog.SaveChoice.DontSave: doc.Saved = true; break; } } }
private void saveToolStripMenuItem_Click(object sender, EventArgs e) { if (SaveDialog.ShowDialog() == DialogResult.OK) { BinaryFormatter binFormater = new BinaryFormatter(); List <ISerializable> ListSerializeObj = Canvas.Controls.OfType <ISerializable>().ToList(); ListSerializeObj = ListSerializeObj.Concat(ListEdge.ToList <ISerializable>()).ToList <ISerializable>(); using (Stream fstream = new FileStream(SaveDialog.FileName, FileMode.Create, FileAccess.Write, FileShare.None)) binFormater.Serialize(fstream, ListSerializeObj); } }
private void ShowSaveJsonObjectDialog <T>(T objectToSave) { SaveDialog.InitialDirectory = JsonFiles.JsonFilePaths[typeof(T).Name]; SaveDialog.ShowDialog(); if (SaveDialog.FileName != "") { JsonFiles.SaveAs <T>(SaveDialog.FileName, objectToSave); } }
private void exportDataToolStripMenuItem_Click(object sender, EventArgs e) { if (SaveDialog.ShowDialog() == DialogResult.OK) { string exportPath = SaveDialog.FileName; SendCmd("export_data!"); string data = RecieveMessage(); System.IO.File.AppendAllText(exportPath, data); MessageBox.Show("Data exported."); } }
private void menuItem7_Click(object sender, EventArgs e) { if (DSave.GetEnvironment() == "Untitled.ddproj") { SaveDialog.ShowDialog(); } else { DSave.Save(); } }
private void button1_Click(object sender, EventArgs e) { if (TextBox_CallName.TextLength > 0 && TextBox_DName.TextLength > 0 && FlowPanel.Controls.Count > 0) { SaveDialog.FileName = ""; SaveDialog.ShowDialog(); } else { MessageBox.Show("Some required fields are missing!"); } }
/** * Save the content of memory to a binary file. */ private void SaveButton_Click(object sender, EventArgs e) { if (SaveDialog.ShowDialog() == DialogResult.OK) { FileStream outputFile = File.Create(SaveDialog.FileName); MemoryRAM ram = (MemoryRAM)Memory; byte[] buffer = new byte[ram.Length]; ram.CopyIntoBuffer(0, buffer, 0, ram.Length); outputFile.Write(buffer, 0, buffer.Length); outputFile.Flush(); outputFile.Close(); } }
private void creaEPUB_Click(object sender, EventArgs e) { string FileCopertina = null; string FileCalendario1 = null; string FileCalendario2 = null; if (rtxS == null) { MessageBox.Show("File ODT non caricato"); return; } OpenDialog.Filter = "JPEG File|*.jpg"; OpenDialog.Title = "Selezionare immagine di copertina"; OpenDialog.FileName = ""; if (OpenDialog.ShowDialog() == DialogResult.OK) { FileCopertina = OpenDialog.FileName; } OpenDialog.Filter = "JPEG File|*.jpg"; OpenDialog.Title = "Selezionare immagine del calendario1"; OpenDialog.FileName = ""; if (OpenDialog.ShowDialog() == DialogResult.OK) { FileCalendario1 = OpenDialog.FileName; } OpenDialog.Filter = "JPEG File|*.jpg"; OpenDialog.Title = "Selezionare immagine del calendario2"; OpenDialog.FileName = ""; if (OpenDialog.ShowDialog() == DialogResult.OK) { FileCalendario2 = OpenDialog.FileName; } SaveDialog.Filter = "EPUB File|*.epub"; SaveDialog.FileName = TPQTitle.Text + ".epub"; SaveDialog.Title = "Selezionare percorso per salvataggio file EPUB"; if (SaveDialog.ShowDialog() == DialogResult.OK) { epubW = new EPUBWriter(checkSanti.Checked); epubW.LoadStyle(Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "style_epub.csv")); epubW.LoadBaseFile(); epubW.CreateEpub(SaveDialog.FileName, PQI.dicPQTag, TPQTitle.Text, TISBN.Text, FileCopertina, FileCalendario1, FileCalendario2); CreateMOBI(SaveDialog.FileName); MessageBox.Show("OK"); } }
private void SaveResult_Click(object sender, EventArgs e) // Select directory path after click on Set Index Directory { SaveFileDialog saveDialog = new SaveFileDialog(); SaveDialog.Filter = "Text File | *.txt"; if (SaveDialog.ShowDialog() == DialogResult.OK) { savePath = SaveDialog.FileName; StreamWriter writer = new StreamWriter(savePath, append: true); Program.SaveClick(resultListDict, writer, queryCount); ConvertBtn.Enabled = true; } }
private void saveToolStripMenuItem_Click(object sender, EventArgs e) { if (currentFilePath != null) { BinaryWriter output = new BinaryWriter(File.OpenWrite(currentFilePath)); output.Write(MapView.MapWidth); output.Write(MapView.MapHeight); for (int i = 0; i < MapView.MapWidth; i++) { for (int j = 0; j < MapView.MapHeight; j++) { output.Write(MapView[i, j].Data.Source); output.Write(MapView[i, j].ImageIndex); output.Write(MapView[i, j].Data.Depth); } } output.Write(MapView.MapEvents.Count); foreach (GameEvent g in MapView.MapEvents) { output.Write((int)g.EventType); switch (g.EventType) { case EventType.Enemy: output.Write(g.XIndex); output.Write(g.YIndex); break; case EventType.Warp: output.Write(g.XIndex); output.Write(g.YIndex); output.Write(g.WarpData.MapName); output.Write(g.WarpData.XOffset); output.Write(g.WarpData.YOffset); break; } } output.Close(); } else { SaveDialog.ShowDialog(); } }