/// <summary>
        /// Saves the options to a TOML file to the location specified by the <see cref="FilePath"/> property.
        /// <para>This file is automatically saved when the program is shutting down if the <see cref="AutoSave"/> property is true.</para>
        /// </summary>
        public void Save()
        {
            ValidateFilePath();

            try
            {
                MinimalTomlParser.SerializeToDisk(this, FilePath);
            }
            catch (Exception ex)
            {
                ErrorLog.Exception("Pellucid.Options", ex);
                Debug.WriteException(this, ex, "Exception while saving Pellucid.Options to disk.");
            }
        }
示例#2
0
        /// <summary>
        /// Saves the options to a TOML file in the application directory.
        /// <para>This file is automatically saved when the program is shutting down.</para>
        /// </summary>
        public void Save()
        {
            var path = Path.Combine(InitialParametersClass.ProgramDirectory.ToString(), "pellucid.console-options.toml");

            MinimalTomlParser.SerializeToDisk(this, path);
        }