forked from synhershko/NAppUpdate
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUpdateTaskHelper.cs
More file actions
42 lines (37 loc) · 1.37 KB
/
Copy pathUpdateTaskHelper.cs
File metadata and controls
42 lines (37 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using System;
using System.Collections.Generic;
using System.IO;
using NAppUpdate.Framework;
using NAppUpdate.Framework.Tasks;
namespace NAppUpdate.SampleApp
{
public class UpdateTaskHelper
{
private readonly UpdateManager _manager;
public IList<UpdateTaskInfo> TaskListInfo { get; private set; }
public string CurrentVersion { get; private set; }
public string UpdateDescription { get; private set; }
public string UpdateFileName { get; private set; }
public string UpdateVersion { get; private set; }
public DateTime? UpdateDate { get; private set; }
public long UpdateFileSize { get; private set; }
public UpdateTaskHelper()
{
_manager = UpdateManager.Instance;
this.GetUpdateTaskInfo();
this.CurrentVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
}
public IList<UpdateTaskInfo> GetUpdateTaskInfo()
{
var taskListInfo = new List<UpdateTaskInfo>();
foreach (IUpdateTask task in _manager.Tasks)
{
var fileTask = task as FileUpdateTask;
if (fileTask == null) continue;
this.UpdateDescription = fileTask.Description;
}
this.TaskListInfo = taskListInfo;
return taskListInfo;
}
}
}