System.IO.Compression.ZipArchiveFile.MoveTo C# (CSharp) Method

MoveTo() public method

Truncates the archiveFile represented by the ZipArchiveFile to be empty and returns a TextWriter that text can be written to (using the default encoding).
public MoveTo ( string newArchivePath ) : void
newArchivePath string The new archive path.
return void
        public void MoveTo(string newArchivePath)
        {
            if (IsReadOnly)
            {
                throw new InvalidOperationException("Archive is ReadOnly");
            }

            _archive.Entries.Remove(_name);
            _name = newArchivePath;
            _archive.Entries[newArchivePath] = this;
        }