From 76fdf5858191ceb2a4c1501bf712ded30f2ef4f4 Mon Sep 17 00:00:00 2001 From: drieseng Date: Wed, 27 Jul 2016 12:52:50 +0200 Subject: [PATCH] Improve slashdocs. --- src/Renci.SshNet/SftpClient.cs | 79 +++++++++++++++++++++------------- 1 file changed, 48 insertions(+), 31 deletions(-) diff --git a/src/Renci.SshNet/SftpClient.cs b/src/Renci.SshNet/SftpClient.cs index 43ad59a6..366ba11f 100644 --- a/src/Renci.SshNet/SftpClient.cs +++ b/src/Renci.SshNet/SftpClient.cs @@ -206,8 +206,8 @@ namespace Renci.SshNet /// Specified whether this instance owns the connection info. /// is null. /// - /// If is true, then the - /// connection info will be disposed when this instance is disposed. + /// If is true, the connection info will be disposed when this + /// instance is disposed. /// private SftpClient(ConnectionInfo connectionInfo, bool ownsConnectionInfo) : this(connectionInfo, ownsConnectionInfo, new ServiceFactory()) @@ -223,8 +223,8 @@ namespace Renci.SshNet /// is null. /// is null. /// - /// If is true, then the - /// connection info will be disposed when this instance is disposed. + /// If is true, the connection info will be disposed when this + /// instance is disposed. /// internal SftpClient(ConnectionInfo connectionInfo, bool ownsConnectionInfo, IServiceFactory serviceFactory) : base(connectionInfo, ownsConnectionInfo, serviceFactory) @@ -438,7 +438,7 @@ namespace Renci.SshNet /// The path. /// The list callback. /// - /// List of directory entries + /// A list of files. /// /// is null. /// Client is not connected. @@ -499,9 +499,9 @@ namespace Renci.SshNet /// /// The pending asynchronous SFTP request. /// - /// List of files + /// A list of files. /// - /// The IAsyncResult object () did not come from the corresponding async method on this type. -or- EndExecute was called multiple times with the same IAsyncResult. + /// The object did not come from the corresponding async method on this type.-or- was called multiple times with the same . public IEnumerable EndListDirectory(IAsyncResult asyncResult) { var ar = asyncResult as SftpListDirectoryAsyncResult; @@ -719,7 +719,7 @@ namespace Renci.SshNet /// Ends an asynchronous file downloading into the stream. /// /// The pending asynchronous SFTP request. - /// The IAsyncResult object () did not come from the corresponding async method on this type. -or- EndExecute was called multiple times with the same IAsyncResult. + /// The object did not come from the corresponding async method on this type.-or- was called multiple times with the same . /// Client is not connected. /// Permission to perform the operation was denied by the remote host. -or- A SSH command was denied by the server. /// The path was not found on the remote host. @@ -944,7 +944,7 @@ namespace Renci.SshNet /// Ends an asynchronous uploading the stream into remote file. /// /// The pending asynchronous SFTP request. - /// The IAsyncResult object () did not come from the corresponding async method on this type. -or- EndExecute was called multiple times with the same IAsyncResult. + /// The object did not come from the corresponding async method on this type.-or- was called multiple times with the same . /// Client is not connected. /// The directory of the file was not found on the remote host. /// Permission to upload the file was denied by the remote host. -or- A SSH command was denied by the server. @@ -965,7 +965,7 @@ namespace Renci.SshNet /// /// The path. /// - /// A reference to object that contains file status information. + /// A instance that contains file status information. /// /// Client is not connected. /// is null. @@ -1220,7 +1220,8 @@ namespace Renci.SshNet /// /// The file or directory for which to obtain access date and time information. /// - /// A structure set to the date and time that the specified file or directory was last accessed. This value is expressed in local time. + /// A structure set to the date and time that the specified file or directory was last accessed. + /// This value is expressed in local time. /// /// is null. /// Client is not connected. @@ -1236,7 +1237,8 @@ namespace Renci.SshNet /// /// The file or directory for which to obtain access date and time information. /// - /// A structure set to the date and time that the specified file or directory was last accessed. This value is expressed in UTC time. + /// A structure set to the date and time that the specified file or directory was last accessed. + /// This value is expressed in UTC time. /// /// is null. /// Client is not connected. @@ -1252,7 +1254,8 @@ namespace Renci.SshNet /// /// The file or directory for which to obtain write date and time information. /// - /// A structure set to the date and time that the specified file or directory was last written to. This value is expressed in local time. + /// A structure set to the date and time that the specified file or directory was last written to. + /// This value is expressed in local time. /// /// is null. /// Client is not connected. @@ -1268,7 +1271,8 @@ namespace Renci.SshNet /// /// The file or directory for which to obtain write date and time information. /// - /// A structure set to the date and time that the specified file or directory was last written to. This value is expressed in UTC time. + /// A structure set to the date and time that the specified file or directory was last written to. + /// This value is expressed in UTC time. /// /// is null. /// Client is not connected. @@ -1366,7 +1370,7 @@ namespace Renci.SshNet } /// - /// Opens a binary file, reads the contents of the file into a byte array, and then closes the file. + /// Opens a binary file, reads the contents of the file into a byte array, and closes the file. /// /// The file to open for reading. /// @@ -1386,7 +1390,7 @@ namespace Renci.SshNet } /// - /// Opens a text file, reads all lines of the file using UTF-8 encoding, and then closes the file. + /// Opens a text file, reads all lines of the file using UTF-8 encoding, and closes the file. /// /// The file to open for reading. /// @@ -1401,7 +1405,7 @@ namespace Renci.SshNet } /// - /// Opens a file, reads all lines of the file with the specified encoding, and then closes the file. + /// Opens a file, reads all lines of the file with the specified encoding, and closes the file. /// /// The file to open for reading. /// The encoding applied to the contents of the file. @@ -1425,7 +1429,7 @@ namespace Renci.SshNet } /// - /// Opens a text file, reads all lines of the file with the UTF-8 encoding, and then closes the file. + /// Opens a text file, reads all lines of the file with the UTF-8 encoding, and closes the file. /// /// The file to open for reading. /// @@ -1440,7 +1444,7 @@ namespace Renci.SshNet } /// - /// Opens a file, reads all lines of the file with the specified encoding, and then closes the file. + /// Opens a file, reads all lines of the file with the specified encoding, and closes the file. /// /// The file to open for reading. /// The encoding applied to the contents of the file. @@ -1711,7 +1715,9 @@ namespace Renci.SshNet /// Gets the of the file on the path. /// /// The path to the file. - /// The of the file on the path. + /// + /// The of the file on the path. + /// /// is null. /// Client is not connected. /// was not found on the remote host. @@ -1767,9 +1773,19 @@ namespace Renci.SshNet /// The source path. /// The destination path. /// The search pattern. - /// List of uploaded files. + /// + /// A list of uploaded files. + /// + /// is null. + /// is null or contains only whitespace. + /// was not found on the remote host. public IEnumerable SynchronizeDirectories(string sourcePath, string destinationPath, string searchPattern) { + if (sourcePath == null) + throw new ArgumentNullException("sourcePath"); + if (destinationPath.IsNullOrWhiteSpace()) + throw new ArgumentException("destinationPath"); + return InternalSynchronizeDirectories(sourcePath, destinationPath, searchPattern, null); } @@ -1782,10 +1798,10 @@ namespace Renci.SshNet /// The async callback. /// The state. /// - /// An that represents the asynchronous directory synchronization. + /// An that represents the asynchronous directory synchronization. /// - /// is null. - /// is null or contains only whitespace. + /// is null. + /// is null or contains only whitespace. public IAsyncResult BeginSynchronizeDirectories(string sourcePath, string destinationPath, string searchPattern, AsyncCallback asyncCallback, object state) { if (sourcePath == null) @@ -1816,8 +1832,11 @@ namespace Renci.SshNet /// Ends the synchronize directories. /// /// The async result. - /// List of uploaded files. - /// Either the IAsyncResult object did not come from the corresponding async method on this type, or EndExecute was called multiple times with the same IAsyncResult. + /// + /// A list of uploaded files. + /// + /// The object did not come from the corresponding async method on this type.-or- was called multiple times with the same . + /// The destination path was not found on the remote host. public IEnumerable EndSynchronizeDirectories(IAsyncResult asyncResult) { var ar = asyncResult as SftpSynchronizeDirectoriesAsyncResult; @@ -1831,9 +1850,6 @@ namespace Renci.SshNet private IEnumerable InternalSynchronizeDirectories(string sourcePath, string destinationPath, string searchPattern, SftpSynchronizeDirectoriesAsyncResult asynchResult) { - if (destinationPath.IsNullOrWhiteSpace()) - throw new ArgumentException("destinationPath"); - if (!Directory.Exists(sourcePath)) throw new FileNotFoundException(string.Format("Source directory not found: {0}", sourcePath)); @@ -1909,8 +1925,9 @@ namespace Renci.SshNet /// /// The path. /// The list callback. - /// - /// path + /// + /// A list of files in the specfied directory. + /// /// is null. /// Client not connected. private IEnumerable InternalListDirectory(string path, Action listCallback)