Added comments.

This commit is contained in:
Holger Börchers 2018-03-22 08:16:17 +01:00
parent 9dd3943448
commit 715e93985d

@ -10,6 +10,9 @@ using System.Threading.Tasks;
namespace Katteker
{
/// <summary>
/// Update manager, which handles the updates.
/// </summary>
public class UpdateManager
{
private static readonly string _baseDir = AppDomain.CurrentDomain.BaseDirectory;
@ -40,6 +43,13 @@ namespace Katteker
/// </summary>
public string UrlOrPath => _urlOrPath;
/// <summary>
/// Create the update manager.
/// </summary>
/// <param name="urlOrPath">path to the publishing directory</param>
/// <param name="applicationName">name of the application to update.</param>
/// <param name="rootDirectory">root directory.</param>
/// <returns>the update manager.</returns>
public static UpdateManager Create(string urlOrPath = null, string applicationName = null, string rootDirectory = null)
{
_config = ReadConfigFile();
@ -49,6 +59,14 @@ namespace Katteker
return new UpdateManager(urlOrPath, appName, rootAppDirectory);
}
/// <summary>
/// Try to create the update manager.
/// </summary>
/// <param name="manager">update manager</param>
/// <param name="urlOrPath">path to the publishing directory</param>
/// <param name="applicationName">name of the application to update.</param>
/// <param name="rootDirectory">root directory.</param>
/// <returns>true if the creation success, false otherwise.</returns>
public static bool TryCreate(out UpdateManager manager, string urlOrPath = null, string applicationName = null, string rootDirectory = null)
{
try
@ -69,6 +87,11 @@ namespace Katteker
return updateInfo.ReleasesToApply;
}
/// <summary>
/// Restart the application.
/// </summary>
/// <param name="exeToStart"></param>
/// <param name="arguments"></param>
public void RestartApp(string exeToStart = null, string arguments = null)
{
exeToStart = exeToStart ?? Path.GetFileName(Assembly.GetEntryAssembly().Location);
@ -81,6 +104,11 @@ namespace Katteker
}
}
/// <summary>
/// Update application.
/// </summary>
/// <param name="progress">The updating process.</param>
/// <returns></returns>
public async Task<bool> UpdateAppAsync(IProgress<int> progress = null)
{
progress?.Report(0);