Skip to content

Commit 386b61f

Browse files
committed
Add Update mechanism Fix #164
1 parent f6d7871 commit 386b61f

File tree

3 files changed

+41
-2
lines changed

3 files changed

+41
-2
lines changed

Analogy.LogViewer.Serilog/Analogy.LogViewer.Serilog.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@
2020
<PackageIcon>AnalogySerilog.png</PackageIcon>
2121
<PackageIconUrl />
2222
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
23-
<Version>2.1.2</Version>
23+
<Version>2.1.3</Version>
2424
<Company>Analogy.LogViewer</Company>
2525
<GenerateResourceUsePreserializedResources>true</GenerateResourceUsePreserializedResources>
26+
<Nullable>enable</Nullable>
27+
<LangVersion>8.0</LangVersion>
2628
</PropertyGroup>
2729

2830
<ItemGroup>

Analogy.LogViewer.Serilog/ChangeLogList.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ namespace Analogy.LogViewer.Serilog
77
public static class ChangeLogList
88
{
99
public static IEnumerable<AnalogyChangeLog> GetChangeLog() =>
10-
new List<AnalogyChangeLog>()
10+
new List<AnalogyChangeLog>
1111
{
12+
new AnalogyChangeLog("[V2.1.3] - Add Update mechanism #164", AnalogChangeLogType.Improvement, "Lior Banai", new DateTime(2020, 10, 25)),
1213
new AnalogyChangeLog("[V2.1.1] - When application is not running in admin UnauthorizedAccessException can be thrown #150", AnalogChangeLogType.Improvement, "Lior Banai", new DateTime(2020, 10, 21)),
1314
new AnalogyChangeLog("[V2.1.0] - Serilog Trace Log Level are skipped in the parsers since debug is default level #148", AnalogChangeLogType.Bug, "Darko Vujičić", new DateTime(2020, 10, 18)),
1415
new AnalogyChangeLog("[V2.1.0] - [Implementation] Simplified code by using Analogy.LogViewer.Template as base implementation #121", AnalogChangeLogType.Improvement, "Lior Banai", new DateTime(2020, 10, 06)),
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Diagnostics;
4+
using System.Linq;
5+
using System.Reflection;
6+
using System.Runtime.Versioning;
7+
using System.Text;
8+
using System.Threading.Tasks;
9+
10+
namespace Analogy.LogViewer.Serilog.IAnalogy
11+
{
12+
public class SerilogDownloadInformation : Analogy.LogViewer.Template.AnalogyDownloadInformation
13+
{
14+
protected override string RepositoryURL { get; set; } = "https://api.github.com/repos/Analogy-LogViewer/Analogy.LogViewer.Serilog";
15+
public override TargetFrameworkAttribute CurrentFrameworkAttribute { get; set; } = (TargetFrameworkAttribute)Assembly.GetExecutingAssembly().GetCustomAttribute(typeof(TargetFrameworkAttribute));
16+
17+
public override Guid FactoryId { get; set; } = PrimaryFactory.Id;
18+
public override string Name { get; set; } = "Serilog Data Provider";
19+
20+
private string? _installedVersionNumber;
21+
public override string InstalledVersionNumber
22+
{
23+
get
24+
{
25+
if (_installedVersionNumber != null)
26+
{
27+
return _installedVersionNumber;
28+
}
29+
Assembly assembly = Assembly.GetExecutingAssembly();
30+
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(assembly.Location);
31+
_installedVersionNumber = fvi.FileVersion;
32+
return _installedVersionNumber;
33+
}
34+
}
35+
}
36+
}

0 commit comments

Comments
 (0)