/// <summary> /// Installs a patch. /// </summary> /// <param name="patchName">Name of the patch.</param> public void Install(ClientPatchName patchName) { // Return if the patch is installed and up to date. var patch = this.GetPatch(patchName); if (patch.Installed && !patch.UpdateAvailable) { return; } // Install the patch. patch.Install(); }
/// <summary> /// Uninstalls a patch. /// </summary> /// <param name="patchName">Name of the patch.</param> public void Uninstall(ClientPatchName patchName) { // Return if the patch is not installed. var patch = this.GetPatch(patchName); if (!patch.Installed) { return; } // Uninstall the patch. patch.Uninstall(); }
/// <summary> /// Returns if a patch is installed /// </summary> /// <param name="patchName"></param> /// <returns>Whether the patch is installed.</returns> public bool IsInstalled(ClientPatchName patchName) { return(this.GetPatch(patchName).Installed); }
/// <summary> /// Returns if an update is available for the patch. /// </summary> /// <param name="patchName">Patch to check for.</param> /// <returns>Whether an update is available for the patch.</returns> public bool IsUpdateAvailable(ClientPatchName patchName) { return(this.GetPatch(patchName).UpdateAvailable); }
/// <summary> /// Returns the patch for the given name. /// </summary> /// <param name="patchName">Patch name to search for.</param> private IPatch GetPatch(ClientPatchName patchName) { return(this.Patches.First(patch => patch.PatchEnum == patchName)); }