protected override void CustomProcessRequest(HttpContext context) { UpdateFactory factory = new UpdateFactory(context); IUpdateBehavior updateBehavior = factory.Create(); updateBehavior.Update(); }
/// <summary> /// Apply downloaded updates. Method will execute behavior method after files are unpacked. /// </summary> /// <param name="behavior">Defines behavior of update method after files are unpacked. For example you can backup your database etc.</param> /// <param name="publicToken">Public token is used to unpack files in UpdatePackage. Public token can be obtained while using BitsUpdatePacker app and creating package.</param> /// <returns>True if everything went well.</returns> public bool Update(IUpdateBehavior behavior, string publicToken) { if (_status.NextVersion > Assembly.GetEntryAssembly().GetName().Version&& File.Exists(GetUpdateSaveLocation())) { UpdatePackage.Extract(new DirectoryInfo(string.Format(_updateDirectory, _status.NextVersion)), _status.NextVersion, publicToken); if (behavior != null) { behavior.Execute(); } return(true); } return(false); }
public TipoItem(IUpdateBehavior ibehavior) { this.ibehavior = ibehavior; }
/// <summary> /// Apply downloaded updates. Method will execute behavior method after files are unpacked. /// </summary> /// <param name="behavior">Defines behavior of update method after files are unpacked. For example you can backup your database etc.</param> /// <param name="publicToken">Public token is used to unpack files in UpdatePackage. Public token can be obtained while using BitsUpdatePacker app and creating package.</param> /// <returns>True if everything went well.</returns> public bool Update(IUpdateBehavior behavior, string publicToken) { if (_status.NextVersion > Assembly.GetEntryAssembly().GetName().Version && File.Exists(GetUpdateSaveLocation())) { UpdatePackage.Extract(new DirectoryInfo(string.Format(_updateDirectory, _status.NextVersion)), _status.NextVersion, publicToken); if (behavior != null) { behavior.Execute(); } return true; } return false; }