Microsoft.Azure.Commands.Batch.Models.BatchClient.DownloadRemoteDesktopProtocolFile C# (CSharp) Method

DownloadRemoteDesktopProtocolFile() public method

Downloads a Remote Desktop Protocol file using the specified options.
public DownloadRemoteDesktopProtocolFile ( DownloadRemoteDesktopProtocolFileOptions options ) : void
options DownloadRemoteDesktopProtocolFileOptions The download options.
return void
        public void DownloadRemoteDesktopProtocolFile(DownloadRemoteDesktopProtocolFileOptions options)
        {
            if (options == null)
            {
                throw new ArgumentNullException("options");
            }

            if (options.Stream != null)
            {
                // Don't dispose supplied Stream
                CopyRDPStream(options.Stream, options.Context.BatchOMClient, options.PoolId, options.ComputeNodeId, options.ComputeNode, options.AdditionalBehaviors);
            }
            else
            {
                string computeNodeId = options.ComputeNode == null ? options.ComputeNodeId : options.ComputeNode.Id;
                WriteVerbose(string.Format(Resources.DownloadingRDPFile, computeNodeId, options.DestinationPath));

                using (FileStream fs = new FileStream(options.DestinationPath, FileMode.Create))
                {
                    CopyRDPStream(fs, options.Context.BatchOMClient, options.PoolId, options.ComputeNodeId, options.ComputeNode, options.AdditionalBehaviors);
                }
            }
        }
BatchClient