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); } } }
/// <summary> /// Before closing. /// </summary> /// <param name="e">used for decision whether to close form or not</param> protected override void OnFormClosing(FormClosingEventArgs e) { if (this.IsModified) { if (isAutoValidate) { DialogResult result = new SaveDialog().ShowDialog(); switch (result) { case DialogResult.Cancel: e.Cancel = true; break; case DialogResult.No: AutoValidate = System.Windows.Forms.AutoValidate.Disable; isAutoValidate = false; e.Cancel = false; log.Warn(string.Format("The form {0} has been closed without saving.", this.ToString())); break; case DialogResult.Yes: if (SaveCommand != null && SaveCommand.CanExecute()) { SaveCommand.Execute(); } break; default: break; } } } base.OnFormClosing(e); }
private void SaveGame() { if (World == null) { ShowMessage("No World", "No game is currently loaded"); return; } var sf = new SaveDialog("Save Game", "Enter save file path") { AllowedFileTypes = new[] { ".json" } }; Application.Run(sf); if (sf.FileName != null) { var f = sf.FileName.EndsWith(".json") ? sf.FileName : sf.FileName + ".json"; try { var json = JsonConvert.SerializeObject(World, Wanderer.World.GetJsonSerializerSettings()); File.WriteAllText(f.ToString(), json); } catch (Exception e) { ShowException("Failed to Save", e); } } }
public Record(IToggle toggle, SandboxControl control, IPrim hostPrim, IPrimFactory factory, IConfig controlConfig) : base(toggle) { _control = control; _save = new SaveDialog(hostPrim, factory, "sequence", control.DefaultRecordingName, name => control.Record.GetFolder(name)); _save.OnSave += (name, id, file) => control.Record.SaveRecording(name, file); }
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); }
public CreateTopologyControl(IKeyTableFactory tableFactory, IAsynchQueueFactory queueFactory, IPrimFactory primFactory, IModel model, IConfigSource config) : base(tableFactory, queueFactory, primFactory, model, config) { /* * //Touch Button * IButton floor = Factory.MakeButton("Floor", Permissions, HostPrim.ID); * floor.OnTouched += (source, args) => AddRouter(args.AvatarName, args.AvatarID, args.TouchPosition); */ IConfig controlConfig = config.Configs["Control"]; string god = controlConfig.Get(GOD_KEY, GOD); string topologyDefault = controlConfig.Get(TOPOLOGY_KEY, GOD); _listener = (name, id, text, channel) => { string[] args = text.Split(' '); if (id.Equals(HostPrim.Owner) && args[0].ToUpper().Equals("SAVE")) { if (args.Length > 1) { HostPrim.Say("Saving topology as " + args[1]); Topology.SaveTopology(name, id, args[1]); } else { HostPrim.Say("Showing Dialog"); SaveDialog save = new SaveDialog(HostPrim, primFactory, "Topology", topologyDefault, user => Topology.GetUserFolder(god)); save.OnSave += (userName, userID, file) => Topology.SaveTopology(name, id, file); save.Show(name, id); } } }; primFactory.OnChat += _listener; }
private bool SaveAs() { var sd = new SaveDialog("Save file", "Choose the path where to save the file."); sd.FilePath = System.IO.Path.Combine(sd.FilePath.ToString(), Win.Title.ToString()); Application.Run(sd); if (!sd.Canceled) { if (System.IO.File.Exists(sd.FilePath.ToString())) { if (MessageBox.Query("Save File", "File already exists. Overwrite any way?", "No", "Ok") == 1) { return(SaveFile(sd.FileName.ToString(), sd.FilePath.ToString())); } else { _saved = false; return(_saved); } } else { return(SaveFile(sd.FileName.ToString(), sd.FilePath.ToString())); } } else { _saved = false; return(_saved); } }
private void buttonSaveToXML_Click(object sender, EventArgs e) { if (SaveDialog.ShowDialog() == DialogResult.OK) { _sqlContext.MetadataContainer.ExportToXML(SaveDialog.FileName); } }
/// <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(); } }
public async Task OpenDialogAsync(DialogToNavigate dialogToNavigate, UserOptions userOptions = null) { if (dialogToNavigate == DialogToNavigate.Setup) { await AppLocator.SetupViewModel.Initialize(); SetupDialog setupDialog = new SetupDialog(); setupDialog.DataContext = AppLocator.SetupViewModel; await setupDialog.ShowAsync(); } else { if (userOptions == null) { userOptions = new UserOptions(); } await AppLocator.SaveViewModel.Initialize(); SaveDialog saveDialog = new SaveDialog(); var saveVM = AppLocator.SaveViewModel; saveVM.UserOptions = userOptions; saveDialog.DataContext = saveVM; await saveDialog.ShowAsync(); } }
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); }
/// <summary> /// 打开路径选择界面,选择路径,将csv点表中的信息存储在cps中 /// </summary> public void GetCps() { string path = SaveDialog.SelectPath(); cps = GetPoint(path); Debug.Log(cps["P1"].name); }
private static void SaveCommonSecretsFileAs() { var allowedFileExtensions = new List <string> () { ".json", ".xml" }; var sd = new SaveDialog("Save file", "Choose the path where to save the file.", allowedFileExtensions); //sd.FilePath = System.IO.Path.Combine (sd.FilePath.ToString (), Win.Title.ToString ()); Application.Run(sd); if (!sd.Canceled) { if (System.IO.File.Exists(sd.FilePath.ToString())) { if (MessageBox.Query("Save File", "File already exists. Overwrite any way?", "No", "Ok") == 1) { // Overwrite existing file } else { // Do nothing } } else { // Create a new file } } else { // Saving canceled } }
private void MISaveAs_Click(object sender, EventArgs e) { if (SaveDialog.ShowDialog() == DialogResult.OK) { Modeller.Save(SaveDialog.FileName); } }
public async Task <StorageFolder> SaveProject(StorageFolder storageFolder, List <InkStrokeContainer> strokes, ProjectMetaData metaData, List <CanvasComponent> components) { //Use existing folder if (storageFolder != null) { //Save the strokes drawn, the project metadata so the current state of the eapplication is saved, and the shapes SaveStrokes(storageFolder, strokes); SaveMetaData(metaData, storageFolder); SaveCanvasComponents(components, storageFolder); return(storageFolder); } //Create new folder to save files SaveDialog save = new SaveDialog(); await save.ShowAsync(); if (save.result == ContentDialogResult.Primary) { //Store the chosen folder so it is automatically saved to the location specified in the future storageFolder = save.folder; SaveStrokes(storageFolder, strokes); SaveMetaData(metaData, storageFolder); SaveCanvasComponents(components, storageFolder); return(storageFolder); } return(null); }
static void Save() { var d = new SaveDialog("Save", "Save to file"); Application.Run(d); if (!d.Canceled) { currentFileName = d.FilePath.ToString(); if (File.Exists(currentFileName)) { var result = MessageBox.Query(50, 7, "File exists. Overwrite ? ", currentFileName, "OK", "Cancel"); if (result != 0) { return; } } string sourceCode = s8parser.GetSourceCode(); using (StreamWriter sw = new StreamWriter(currentFileName)) { sw.Write(sourceCode); sw.Flush(); sw.Close(); } MessageBox.Query(50, 7, $"Saved file. {sourceCode.Length} bytes.", currentFileName, "OK"); } }
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); } }
public Form1() { InitializeComponent(); disableControls(); // skapa ny spara-ruta this.saveDialog = new SaveDialog(); //Fixa till datarelationer för lagen. team1Dv.Table = teamsDt; team2Dv.Table = teamsDt; // initiera och fyll med data FillDatatable(); this.clearAllData(); this.initFieldsData(); //Hanterare för events från Caspar. caspar_.Connected += new EventHandler <NetworkEventArgs>(caspar__Connected); caspar_.FailedConnect += new EventHandler <NetworkEventArgs>(caspar__FailedConnected); caspar_.Disconnected += new EventHandler <NetworkEventArgs>(caspar__Disconnected); //caspar_.UpdatedTemplates += new EventHandler<EventArgs>(caspar__UpdatedTemplates); //caspar_.UpdatedMediafiles += new EventHandler<EventArgs>(caspar__UpdatedMediafiles); caspar_.DataRetrieved += new EventHandler <DataEventArgs>(caspar__DataRetrieved); caspar_.UpdatedDatafiles += new EventHandler <EventArgs>(caspar__UpdatedDataFiles); caspar_.UpdatedMediafiles += new EventHandler <EventArgs>(caspar__UpdatedMediaFiles); updateConnectButtonText(); // Show the CheckBox and display the control as an up-down control. //dtCountDownTime.CustomFormat = "yyyy-MM-dd HH:mm"; }
void OnFileViewAddNew(object sender, EventArgs e) { if (SaveDialog.ShowDialog(this) == DialogResult.OK) { FileAdd(OpenDialog.FileNames, true); } }
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 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); } }
public override bool Run() { if (CodeInfo is null || CodePath is null) { Status.WriteLine(Severity.Error, "Application error. Must choose the code repo against which to run this report."); } try { Contract.Requires(Directory.Exists(CodePath)); Contract.Requires(Directory.Exists(Path.Combine(CodePath, ".git"))); } catch { MessageBox.Show("Invalid code directory."); return(false); } LinkMap.Clear(); var helper = new RepoHelper(); try { using (var docRepo = helper.GetRepository(DocPath)) using (var codeRepo = helper.GetRepository(CodePath)) { FindRelevantCodeLinks(docRepo, codeRepo); BackfillCommitDates(LinkMap.DocFileIndex.Keys, docRepo, helper); BackfillCommitDates(LinkMap.CodeFileIndex.Keys, codeRepo, helper); } if (LinkMap.IsEmpty) { Status.WriteLine(Severity.Warning, "No code links found in this repo."); return(false); } else { Status.WriteLine(Severity.Information, "Found links to " + $"{LinkMap.CodeFileIndex.Count} code files, linked to from " + $"{LinkMap.DocFileIndex.Count} doc files."); SaveDialog.Title = "Choose where to save the code link report:"; var result = SaveDialog.TrySave((writer) => { WriteReport(writer); }); Status.WriteLine(result.Sev, result.Message); if (result.Reason == DialogResult.OK) { return(true); } } } catch (Exception ex) { Status.WriteLine(Severity.Error, $"{ex.GetType().Name}: {ex.Message}"); } return(false); }
private void SaveFileBtn_Click(object sender, EventArgs e) { if (SaveDialog.ShowDialog() == DialogResult.OK) { this.SetSettings(); Savior.SaveToFile(settings, SaveDialog.FileName); } }
private void SaveButton_Click(object sender, EventArgs e) { if (SaveDialog.ShowDialog() == DialogResult.OK) { string fileName = SaveDialog.FileName; SaveFileDialog(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; } }
/// <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 SaveToFile(object sender, EventArgs e) { if (SaveDialog.ShowDialog() == DialogResult.OK) { TextBox.SaveFile(SaveDialog.OpenFile(), RichTextBoxStreamType.PlainText); SetStatus(Resources.Statuses.LogSaved + SaveDialog.FileName); } }
private void ChooseXLSXToolStripMenuItem_Click(object sender, EventArgs e) { if (SaveDialog.ShowDialog(this) != DialogResult.OK) { return; } XLSXTextBox.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 rotateThroughSaveDialog(int direction) { object val = Convert.ChangeType(saveMenu, saveMenu.GetTypeCode()); int m = Convert.ToInt32(val); // should not rotate to UNKOWN = 0 if (direction == -1) { if (m == 1) { m = _maxSaveMode; } else { m--; } } else { m = Math.Max(1, (++m) % (_maxSaveMode + 1)); } saveMenu = (SaveDialog)Enum.ToObject(typeof(SaveDialog), m); comunicateSaveDialogSwitch(saveMenu); }
/// <summary> /// close editing Dialog and save Changes if saveChanges is true /// </summary> /// <param name="saveChanges">if set to <c>true</c> [save changes].</param> private void CloseImageDialog(bool saveChanges) { string audioOutput = ""; if (saveChanges) { var shape = getSelectedShape(); if (shape != null) { if (shape.Equals(_shape)) // original selected shape is still selected { SaveBrailleInput(selectedPropertyMenuItem, removeInputStr(selectedPropertyMenuItem, Property.None)); //save actual bki because Dictionary content is written to imageData shape.Description = propertiesDic["description"]; shape.Title = propertiesDic["title"]; audioOutput = LL.GetTrans("tangram.lector.image_data.cahnges.saved"); } } } else { audioOutput += LL.GetTrans("tangram.lector.image_data.cahnges.not_saved"); } _shape = null; saveMenu = SaveDialog.NonActive; gui_Menu.resetGuiMenu(); audioOutput += " " + LL.GetTrans("tangram.lector.image_data.dialog_closed"); audioRenderer.PlaySoundImmediately(audioOutput); //change Interaction mode InteractionManager.Instance.ChangeMode(InteractionMode.Normal); OoElementSpeaker.PlayElement(getSelectedShape(), LL.GetTrans("tangram.lector.oo_observer.selected")); this.Active = false; foreach (var key in detailViewDic.Keys) { if (detailViewDic[key] != null) { detailViewDic[key].SetVisibility(false); } } WindowManager.Instance.SetTopRegionContent(WindowManager.Instance.GetMainscreenTitle()); ////////////////////////////////////////////////////////////////////////// //TODO: start blinking again ////////////////////////////////////////////////////////////////////////// }
protected override void im_ButtonCombinationReleased(object sender, ButtonReleasedEventArgs e) { if ((e.ReleasedGenericKeys.Count == 1 && e.ReleasedGenericKeys[0] == "crc") || (e.ReleasedGenericKeys.Count == 2 && e.ReleasedGenericKeys.Contains("crc") && (e.ReleasedGenericKeys.Contains("cru") || e.ReleasedGenericKeys.Contains("crl") || e.ReleasedGenericKeys.Contains("crr") || e.ReleasedGenericKeys.Contains("crd")))) { switch (saveMenu) { case SaveDialog.NonActive: //first call make save dialog visible //saveDialog = SaveDialog.Active; Logger.Instance.Log(LogPriority.MIDDLE, this, "[SHAPE EDIT DIALOG] open save dialog"); saveMenu = SaveDialog.Save; showMenuDetailView(); UnderLiningHook.selectedString = LL.GetTrans("tangram.lector.image_data.save"); SaveBrailleInput(activeProperty, removeInputStr(activeProperty, Property.None)); audioRenderer.PlaySoundImmediately( LL.GetTrans("tangram.lector.image_data.save_dialog.opend") + " " + LL.GetTrans("tangram.lector.image_data.save_dialog.entry_selected" , LL.GetTrans("tangram.lector.image_data.save"))); break; case SaveDialog.Abort: //close save dialog saveMenu = SaveDialog.NonActive; Logger.Instance.Log(LogPriority.MIDDLE, this, "[SHAPE EDIT DIALOG] save menu aborted"); detailViewDic[TITLE_DESC_SAVE_VIEW_NAME].SetVisibility(false); ShowImageDetailView(TITLE_DESC_VIEW_NAME, 15, 0, activeProperty); break; case SaveDialog.NotSave: // quit dialog without saving changes CloseImageDialog(false); Logger.Instance.Log(LogPriority.MIDDLE, this, "[SHAPE EDIT DIALOG] changes were not saved, dialog closed"); break; case SaveDialog.Save: // quit dialog and save changes CloseImageDialog(true); Logger.Instance.Log(LogPriority.MIDDLE, this, "[SHAPE EDIT DIALOG] changes were saved, dialog closed"); break; } e.Cancel = true; } // bei Verlassen des Dialoges else if (e.ReleasedGenericKeys.Count == 1 && e.PressedGenericKeys.Count == 0) { switch (e.ReleasedGenericKeys[0]) { // scrolling through save, not saving and abort case "crr": //right scrolling through saveCommand if (saveMenu != SaveDialog.NonActive) { rotateThroughSaveDialog(1); } else // editing mode --> move caret to right { bki.MoveCaret(1); Logger.Instance.Log(LogPriority.MIDDLE, this, "[SHAPE EDIT DIALOG] move caret to right"); } e.Cancel = true; break; case "crl": if (saveMenu != SaveDialog.NonActive) { rotateThroughSaveDialog(-1); } else // editing mode --> move caret to left { bki.MoveCaret(-1); Logger.Instance.Log(LogPriority.MIDDLE, this, "[SHAPE EDIT DIALOG] move caret to left"); } e.Cancel = true; break; case "cru": rotateThroughProperties(); e.Cancel = true; break; case "crd": rotateThroughProperties(); e.Cancel = true; break; default: break; } } }
/// <summary> /// Opens up the Save Dialog or Stops Recording /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void OpenSaveDialog(Object sender, EventArgs e) { if (!save) { form1.Enabled = false; saveDialog = new SaveDialog(); saveDialog.StartPosition = FormStartPosition.CenterScreen; saveDialog.Show(); saveDialog.Focus(); saveDialog.setController(this); } else { if (ShowDialog("Möchten Sie die Aufnahmne wirklich beenden?", "Aufnahmen beenden") == DialogResult.OK) //Finalize EDF-File and end save process EndSave(); } }
private void comunicateSaveDialogSwitch(SaveDialog saveDialog) { String command = ""; switch (saveDialog) { case SaveDialog.Save: command = LL.GetTrans("tangram.lector.image_data.save"); break; case SaveDialog.Abort: command = LL.GetTrans("tangram.lector.image_data.cancel"); break; case SaveDialog.NotSave: command = LL.GetTrans("tangram.lector.image_data.not_save"); break; } UnderLiningHook.selectedString = command; AudioRenderer.Instance.PlaySoundImmediately(LL.GetTrans("tangram.lector.oo_observer.selected", command)); Logger.Instance.Log(LogPriority.MIDDLE, this, "[SHAPE EDIT DIALOG] save dialog switch to " + command); }