コード例 #1
0
		/// <summary>
		/// Benutzt die Built-In Dialoge um den Benutzer durch den kompletten Updateprozess zu führen.
		/// </summary>
		/// <param name="owner">Ein beliebiges Objekt, das <see cref="IWin32Window"/> implementiert, das das Fenster der obersten Ebene und damit den Besitzer des modalen Dialogfelds darstellt.</param>
		/// <param name="downloadDialog">Ein beliebiges Objekt, das <see cref="updateDownloadBaseForm"/> implementiert und den Fortschritt des Downloads dem Benutzer anzeigt.</param>
		public void updateInteractive(IWin32Window owner, updateDownloadBaseForm downloadDialog) {
			//Nach Updates suchen
			if (checkForUpdatesDialog(owner) != DialogResult.OK) {
				return;
			}

			if (currentUpdateResult.UpdatesAvailable && alwaysRaiseUpdateFoundEvent) {
				if (updateFound != null)
					updateFound(this, new updateFoundEventArgs(currentUpdateResult));
			}

			//Updatedialog anzeigen
			if (showUpdateDialog(owner) != DialogResult.OK) {
				return;
			}

			//Updates herunterladen
			if (downloadUpdatesDialog(owner, downloadDialog) != DialogResult.OK) {
				return;
			}

			//Updates anwenden
			applyUpdate();
		}
コード例 #2
0
		/// <summary>
		/// Lädt die gefunden Aktualisierungen herunter während dem Benutzer ein modaler Dialog angezeigt wird.
		/// </summary>
		/// <param name="owner">Ein beliebiges Objekt, das <see cref="IWin32Window"/> implementiert, das das Fenster der obersten Ebene und damit den Besitzer des modalen Dialogfelds darstellt.</param>
		/// <param name="downloadDialog">Ein beliebiges Objekt, das <see cref="updateDownloadBaseForm"/> implementiert und den Fortschritt des Downloads dem Benutzer anzeigt.</param>
		/// <returns><see cref="DialogResult.OK"/>wenn der Download erfolgreich abgeschlossen wurde, anderfalls <see cref="DialogResult.Cancel"/>.</returns>
		/// <exception cref="InvalidOperationException">Tritt ein, wenn keine Updates verfügbar sind oder das <see cref="currentUpdateResult"/> null ist.</exception>
		public DialogResult downloadUpdatesDialog(IWin32Window owner, updateDownloadBaseForm downloadDialog) {
			prepareUpdateDownload();

			//Überprüfe ob ein eigener Downloaddialog verwendet werden soll. Ansonsten neuen Dialog instanzieren.
			if (downloadDialog == null) {
				downloadDialog = new updateDownloadDialog();
			}

			//Fenstertitel setzen
			downloadDialog.Text = currentUpdateResult.Configuration.applicationName;

			//Downloaddialog initialisieren
			downloadDialog.initializeForm(this, currentUpdateResult);

			downloadDialog.ShowInTaskbar = showDialogsInTaskbar;

			//Downloaddialog anzeigen
			DialogResult cachedDialogResult = downloadDialog.ShowDialog(owner);
			return cachedDialogResult == DialogResult.OK && downloadDialog.downloadCompleted
			       	? DialogResult.OK
			       	: DialogResult.Cancel;
		}
コード例 #3
0
		/// <summary>
		/// Benutzt die Built-In Dialoge um den Benutzer durch den kompletten Updateprozess zu führen.
		/// </summary>
		/// <param name="downloadDialog">Ein beliebiges Objekt, das <see cref="updateDownloadBaseForm"/> implementiert und den Fortschritt des Downloads dem Benutzer anzeigt.</param>
		public void updateInteractive(updateDownloadBaseForm downloadDialog) {
			updateInteractive(null, downloadDialog);
		}
コード例 #4
0
		/// <summary>
		/// Lädt die gefunden Aktualisierungen herunter während dem Benutzer ein modaler Dialog angezeigt wird.
		/// </summary>
		/// <param name="downloadDialog">Ein beliebiges Objekt, das <see cref="updateDownloadBaseForm"/> implementiert und den Fortschritt des Downloads dem Benutzer anzeigt.</param>
		/// <returns><see cref="DialogResult.OK"/>wenn der Download erfolgreich abgeschlossen wurde, anderfalls <see cref="DialogResult.Cancel"/>.</returns>
		/// <exception cref="InvalidOperationException">Tritt ein, wenn keine Updates verfügbar sind oder das <see cref="currentUpdateResult"/> null ist.</exception>
		public DialogResult downloadUpdatesDialog(updateDownloadBaseForm downloadDialog) {
			return downloadUpdatesDialog(null, downloadDialog);
		}