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);
}
}
}