public UploadProgressDialog(string[] files, MediaVault mediavault, int folderid, int chunksize)
        {
            InitializeComponent();
            fileList = files;
            mediaVault = mediavault;
            defaultChunkSize = chunksize;
            folderId = folderid;

            uploadFileBackgroundWorker.ProgressChanged += new ProgressChangedEventHandler(uploadFileBackgroundWorker_ProgressChanged);
            uploadFileBackgroundWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(uploadFileBackgroundWorker_RunWorkerCompleted);
        }
 /// <summary>
 /// Returns a usable MediaVault object for the given Folder ID.
 /// </summary>
 /// <remarks>
 /// This method should be used to connect to a given MediaVault. While it is possible to connect by instantiating
 /// a new <see cref="Granicus.MediaManager.SDK.MediaVault"/> object and manually connecting it, it is not recommended.</remarks>
 /// <param name="FolderID">The ID of the Folder that the MediaVault object must have access to.</param>
 /// <returns>A connected and usable MediaVault instance for the given folder.</returns>
 public MediaVault GetMediaVault(int FolderID)
 {
     if (!Connected)
     {
         throw new Exception("You must be connected to MediaManager to perform this operation.");
     }
     ServerInterfaceData si = this.GetFolderUploadInterface(FolderID);
     MediaVault mv = new MediaVault();
     mv.Connect(si, Server, ImpersonationToken);
     return mv;
 }
 /// <summary>
 /// Returns a usable MediaVault object for the given ServerInterface.
 /// </summary>
 /// <remarks>
 /// This method should be used to connect to a given MediaVault. While it is possible to connect by instantiating
 /// a new <see cref="Granicus.MediaManager.SDK.MediaVault"/> object and manually connecting it, it is not recommended.</remarks>
 /// <param name="ServerInterface">The ServerInterfaceData object for the desired MediaVault connection.</param>
 /// <returns>A connected and usable MediaVault instance.</returns>
 public MediaVault GetMediaVault(ServerInterfaceData ServerInterface)
 {
     if (!Connected)
     {
         throw new InvalidOperationException("You must be connected to MediaManager to perform this operation.");
     }
     MediaVault mv = new MediaVault();
     mv.Connect(ServerInterface, Server, ImpersonationToken);
     return mv;
 }