Beispiel #1
0
        private static IAsyncFilesCommands SetupCommandsAsync(IAsyncFilesCommands filesCommands, OpenFilesSessionOptions options)
        {
            if (string.IsNullOrWhiteSpace(options.FileSystem))
            {
                throw new ArgumentException("Filesystem cannot be null, empty or whitespace.", "FileSystem");
            }

            filesCommands = filesCommands.ForFileSystem(options.FileSystem);
            if (options.ApiKey != null || options.Credentials != null)
            {
                filesCommands = filesCommands.With(new OperationCredentials(options.ApiKey, options.Credentials));
            }

            return(filesCommands);
        }
Beispiel #2
0
        private static IAsyncFilesCommands SetupCommandsAsync(IAsyncFilesCommands filesCommands, OpenFilesSessionOptions options)
        {
            if (string.IsNullOrWhiteSpace(options.FileSystem))
                throw new ArgumentException("Filesystem cannot be null, empty or whitespace.", "FileSystem");

            filesCommands = filesCommands.ForFileSystem(options.FileSystem);
	        if (options.ApiKey != null || options.Credentials != null)
		        filesCommands = filesCommands.With(new OperationCredentials(options.ApiKey, options.Credentials));
            
            return filesCommands;
        }