diff --git a/Directory.Packages.props b/Directory.Packages.props index a4d12ed86..169d98d16 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -4,25 +4,23 @@ false - + - - + - - + + - + - - + - + \ No newline at end of file diff --git a/src/Renci.SshNet/Common/PortForwardEventArgs.cs b/src/Renci.SshNet/Common/PortForwardEventArgs.cs index 743cdce2c..89def98cf 100644 --- a/src/Renci.SshNet/Common/PortForwardEventArgs.cs +++ b/src/Renci.SshNet/Common/PortForwardEventArgs.cs @@ -6,7 +6,7 @@ namespace Renci.SshNet.Common /// /// Provides data for event. /// - public class PortForwardEventArgs : EventArgs + public sealed class PortForwardEventArgs : EventArgs { /// /// Initializes a new instance of the class. diff --git a/src/Renci.SshNet/Session.cs b/src/Renci.SshNet/Session.cs index dc252c39c..1dfd18a10 100644 --- a/src/Renci.SshNet/Session.cs +++ b/src/Renci.SshNet/Session.cs @@ -30,7 +30,7 @@ namespace Renci.SshNet /// /// Provides functionality to connect and interact with SSH server. /// - public class Session : ISession + public sealed class Session : ISession { internal const byte CarriageReturn = 0x0d; internal const byte LineFeed = 0x0a; @@ -2185,7 +2185,7 @@ public void Dispose() /// Releases unmanaged and - optionally - managed resources. /// /// to release both managed and unmanaged resources; to release only unmanaged resources. - protected virtual void Dispose(bool disposing) + private void Dispose(bool disposing) { if (_disposed) { diff --git a/src/Renci.SshNet/Sftp/SftpFileAttributes.cs b/src/Renci.SshNet/Sftp/SftpFileAttributes.cs index 11d2fd8a8..503e14706 100644 --- a/src/Renci.SshNet/Sftp/SftpFileAttributes.cs +++ b/src/Renci.SshNet/Sftp/SftpFileAttributes.cs @@ -10,7 +10,7 @@ namespace Renci.SshNet.Sftp /// /// Contains SFTP file attributes. /// - public class SftpFileAttributes + public sealed class SftpFileAttributes { #pragma warning disable IDE1006 // Naming Styles #pragma warning disable SA1310 // Field names should not contain underscore diff --git a/src/Renci.SshNet/Sftp/SftpFileStream.cs b/src/Renci.SshNet/Sftp/SftpFileStream.cs index 2965f86e7..0b86595e2 100644 --- a/src/Renci.SshNet/Sftp/SftpFileStream.cs +++ b/src/Renci.SshNet/Sftp/SftpFileStream.cs @@ -16,7 +16,7 @@ namespace Renci.SshNet.Sftp #pragma warning disable IDE0079 // We intentionally want to suppress the below warning. [SuppressMessage("Performance", "CA1844: Provide memory-based overrides of async methods when subclassing 'Stream'", Justification = "TODO: This should be addressed in the future.")] #pragma warning restore IDE0079 - public class SftpFileStream : Stream + public sealed class SftpFileStream : Stream { private readonly Lock _lock = new Lock(); private readonly int _readBufferSize; @@ -162,7 +162,7 @@ public override long Position /// /// The operating system file handle for the file that the current encapsulates. /// - public virtual byte[] Handle + public byte[] Handle { get { diff --git a/src/Renci.SshNet/Sftp/SftpFileSystemInformation.cs b/src/Renci.SshNet/Sftp/SftpFileSystemInformation.cs index c9ae1abd4..a740ad3d8 100644 --- a/src/Renci.SshNet/Sftp/SftpFileSystemInformation.cs +++ b/src/Renci.SshNet/Sftp/SftpFileSystemInformation.cs @@ -3,11 +3,9 @@ namespace Renci.SshNet.Sftp { /// - /// Contains File system information exposed by statvfs@openssh.com request. + /// Contains file system information exposed by statvfs@openssh.com request. /// -#pragma warning disable SA1649 // File name should match first type name - public class SftpFileSystemInformation -#pragma warning restore SA1649 // File name should match first type name + public sealed class SftpFileSystemInformation { #pragma warning disable SA1310 // Field names should not contain underscore internal const ulong SSH_FXE_STATVFS_ST_RDONLY = 0x1; diff --git a/src/Renci.SshNet/Shell.cs b/src/Renci.SshNet/Shell.cs index 909d8f507..c2548e7f7 100644 --- a/src/Renci.SshNet/Shell.cs +++ b/src/Renci.SshNet/Shell.cs @@ -12,7 +12,7 @@ namespace Renci.SshNet /// /// Represents instance of the SSH shell object. /// - public class Shell : IDisposable + public sealed class Shell : IDisposable { private const int DefaultBufferSize = 1024; @@ -315,7 +315,7 @@ public void Dispose() /// Releases unmanaged and - optionally - managed resources. /// /// to release both managed and unmanaged resources; to release only unmanaged resources. - protected virtual void Dispose(bool disposing) + private void Dispose(bool disposing) { if (_disposed) { diff --git a/src/Renci.SshNet/ShellStream.cs b/src/Renci.SshNet/ShellStream.cs index f7dc862ac..e1571c671 100644 --- a/src/Renci.SshNet/ShellStream.cs +++ b/src/Renci.SshNet/ShellStream.cs @@ -17,7 +17,7 @@ namespace Renci.SshNet /// /// Contains operation for working with SSH Shell. /// - public class ShellStream : Stream + public sealed class ShellStream : Stream { private const int DefaultBufferSize = 1024; diff --git a/src/Renci.SshNet/SshCommand.cs b/src/Renci.SshNet/SshCommand.cs index 1a3c6945d..79c61dfd5 100644 --- a/src/Renci.SshNet/SshCommand.cs +++ b/src/Renci.SshNet/SshCommand.cs @@ -16,7 +16,7 @@ namespace Renci.SshNet /// /// Represents an SSH command that can be executed. /// - public class SshCommand : IDisposable + public sealed class SshCommand : IDisposable { private readonly ISession _session; private readonly Encoding _encoding; @@ -630,7 +630,7 @@ public void Dispose() /// Releases unmanaged and - optionally - managed resources. /// /// to release both managed and unmanaged resources; to release only unmanaged resources. - protected virtual void Dispose(bool disposing) + private void Dispose(bool disposing) { if (_isDisposed) {