/// <summary> /// Initialisiert die Updateform. Diese Methode wird automatisch vom <see cref="updateController"/> aufgerufen und muss daher nicht manuell aufgerufen werden. /// </summary> /// <param name="instance">Die Instanz des updateControllers</param> /// <param name="result">Das Suchresultat des UpdateControllers.</param> internal void initializeForm(updateController instance, UpdateResult result) { _updateDownloader = new updateDownloader(instance, result); _updateDownloader.downloadUpdatesCompleted += _updateDownloader_downloadUpdatesCompleted; _updateDownloader.downloadUpdatesProgressChanged += _updateDownloader_downloadUpdatesProgressChanged; Result = result; }
/// <summary> /// <para>Lädt die gefundenen Aktualisierungen asychron herunter.</para> /// <para>Diese Methode blockiert nicht den aufrufenden Thread.</para> /// </summary> /// <exception cref="InvalidOperationException">Tritt ein, wenn keine Updates verfügbar sind oder das <see cref="currentUpdateResult"/> null ist.</exception> /// <exception cref="InvalidOperationException">Tritt ein, wenn der Updatedownload bereits läuft.</exception> public void downloadUpdates() { //Updatedownload vorbereiten prepareUpdateDownload(); //Überprüfe ob der bereits läuft if (_updateDownloader != null) { if (_updateDownloader.isBusy) { throw new InvalidOperationException("Es läuft bereits ein Updatedownload."); } } _updateDownloader = new updateDownloader(this, currentUpdateResult); _updateDownloader.downloadUpdatesProgressChanged += _updateDownloader_downloadUpdatesProgressChanged; _updateDownloader.downloadUpdatesCompleted += _updateDownloader_downloadUpdatesCompleted; _updateDownloader.startDownload(); }