private void btnOK_Click(object sender, EventArgs e) { if (SettingsFromGui()) { _wrapper.SaveToFile(); Close(); } }
/// <summary> /// Saves the currently opened file. Note: only the <see cref="GncFileWrapper"/> is saved! /// The underlying GncSession is not saved. /// </summary> /// <remarks> /// <para>Throws an exception if no file is open.</para> /// </remarks> public static void SaveFile() { if (CurFile == null) { throw new RTException("Internal Error: Cannot SaveFile because no file is currently open."); } CurFile.SaveToFile(); }
/// <summary> /// Closes the current file, if any, and creates a new one under the specified name. /// The new file will have no GnuCash session loaded. /// </summary> public static void NewFile(string filename) { if (CurFile != null) { CloseFile(); } CurFile = new GncFileWrapper(); CurFile.LoadedFromFile = filename; CurFile.SaveToFile(); CurFile.ReloadSession(); AddRecent(filename); }