/// <summary>Adds an update to the update history.</summary> /// <param name="appInfo">The application information.</param> /// <param name="updateInfo">The update information.</param> /// <param name="failed"><c>True</c> if the update failed, otherwise <c>False</c>.</param> static void AddHistory(Sui appInfo, Update updateInfo, bool failed = false) { var hist = new Suh(updateInfo.Name, appInfo.AppInfo.Publisher, updateInfo.Description) { HelpUrl = appInfo.AppInfo.HelpUrl, AppUrl = appInfo.AppInfo.AppUrl, Status = failed == false ? UpdateStatus.Successful : UpdateStatus.Failed, InfoUrl = updateInfo.InfoUrl, InstallDate = DateTime.Now.ToShortDateString(), ReleaseDate = updateInfo.ReleaseDate, Importance = updateInfo.Importance, }; if (UpdateInstalled != null) { UpdateInstalled(null, new UpdateInstalledEventArgs(hist)); } }
/// <summary>Removes an update from the hidden list.</summary> /// <param name="hiddenUpdate">The hidden update to show.</param> /// <returns><c>True</c> if the admin process was executed, otherwise <c>False</c>.</returns> internal static bool ShowUpdate(Suh hiddenUpdate) { if (!Connect()) { return(false); } Task.Factory.StartNew(WaitForAdmin).ContinueWith( delegate { try { context.ShowUpdate(hiddenUpdate); } catch (CommunicationObjectAbortedException) { context = null; IsConnected = false; ErrorOccurred( null, new ErrorOccurredEventArgs(Resources.CouldNotConnectService, ErrorType.FatalError)); } catch (TimeoutException) { ErrorOccurred( null, new ErrorOccurredEventArgs(Resources.CouldNotConnectService, ErrorType.FatalError)); } catch (Exception e) { ErrorOccurred( null, new ErrorOccurredEventArgs(Utilities.GetExceptionAsString(e), ErrorType.FatalError)); throw; } }); return(true); }
/// <summary>Adds an update to the update history.</summary> /// <param name="appInfo">The application information.</param> /// <param name="updateInfo">The update information.</param> /// <param name="failed"><c>True</c> if the update failed, otherwise <c>False</c>.</param> static void AddHistory(Sui appInfo, Update updateInfo, bool failed = false) { var hist = new Suh(updateInfo.Name, appInfo.AppInfo.Publisher, updateInfo.Description) { HelpUrl = appInfo.AppInfo.HelpUrl, AppUrl = appInfo.AppInfo.AppUrl, Status = failed == false ? UpdateStatus.Successful : UpdateStatus.Failed, InfoUrl = updateInfo.InfoUrl, InstallDate = DateTime.Now.ToShortDateString(), ReleaseDate = updateInfo.ReleaseDate, Importance = updateInfo.Importance, }; if (UpdateInstalled != null) { UpdateInstalled(null, new UpdateInstalledEventArgs(hist)); } }
/// <summary>Initializes a new instance of the <see cref="UpdateInstalledEventArgs" /> class.</summary> /// <param name="update">The update information that was installed.</param> public UpdateInstalledEventArgs(Suh update) { this.Update = update; }
/// <summary>Initializes a new instance of the <see cref="UpdateInstalledEventArgs" /> class.</summary> /// <param name="update">The update information that was installed.</param> public UpdateInstalledEventArgs(Suh update) { this.Update = update; }