Save() public method

Saves Feed to an XML file, adds the default stylesheet and sign it it with SecretKey (if specified).
Writing and signing the feed file are performed as an atomic operation (i.e. if signing fails an existing file remains unchanged).
A problem occurs while writing the file. Write access to the file is not permitted. The specified could not be found on the system. was incorrect.
public Save ( [ path, [ passphrase = null ) : void
path [ The file to save in.
passphrase [ The passphrase to use to unlock the secret key; can be null if is null.
return void
示例#1
0
        /// <summary>
        /// Saves feed to an XML file, adds the default stylesheet and signs it with <see cref="Publish.SignedFeed.SecretKey"/> (if specified).
        /// </summary>
        /// <remarks>Writing and signing the feed file are performed as an atomic operation (i.e. if signing fails an existing file remains unchanged).</remarks>
        /// <param name="path">The file to save to.</param>
        /// <exception cref="IOException">A problem occurred while writing the file.</exception>
        /// <exception cref="UnauthorizedAccessException">Write access to the file is not permitted.</exception>
        /// <exception cref="KeyNotFoundException">The specified <see cref="Publish.SignedFeed.SecretKey"/> could not be found on the system.</exception>
        /// <exception cref="WrongPassphraseException"><see cref="Passphrase"/> was incorrect.</exception>
        public override void Save(string path)
        {
            SignedFeed.Save(path, Passphrase);

            Path = path;
            ClearUndo();
        }
示例#2
0
        /// <summary>
        /// Saves <see cref="Feed"/> to an XML file, adds the default stylesheet and signs it with <see cref="Publish.SignedFeed.SecretKey"/> (if specified).
        /// </summary>
        /// <remarks>Writing and signing the feed file are performed as an atomic operation (i.e. if signing fails an existing file remains unchanged).</remarks>
        /// <param name="path">The file to save in.</param>
        /// <exception cref="IOException">A problem occurs while writing the file.</exception>
        /// <exception cref="UnauthorizedAccessException">Write access to the file is not permitted.</exception>
        /// <exception cref="KeyNotFoundException">The specified <see cref="Publish.SignedFeed.SecretKey"/> could not be found on the system.</exception>
        /// <exception cref="WrongPassphraseException"><see cref="Passphrase"/> was incorrect.</exception>
        public void Save([NotNull] string path)
        {
            SignedFeed.Save(path, Passphrase);

            Path = path;
            Reset();
        }