This repository has been archived by the owner on Jun 26, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
134 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace DynamicTranslator.Runtime | ||
{ | ||
public interface IVersionChecker | ||
{ | ||
bool IsNew(string incomingVersion); | ||
|
||
bool IsEqual(string version); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System; | ||
|
||
using Abp.Dependency; | ||
|
||
namespace DynamicTranslator.Runtime | ||
{ | ||
public class VersionChecker : IVersionChecker, ITransientDependency | ||
{ | ||
public bool IsNew(string incomingVersion) | ||
{ | ||
var currentVersion = new Version(ApplicationVersion.GetCurrentVersion()); | ||
var newVersion = new Version(incomingVersion); | ||
|
||
return newVersion > currentVersion; | ||
} | ||
|
||
public bool IsEqual(string version) | ||
{ | ||
var currentVersion = new Version(ApplicationVersion.GetCurrentVersion()); | ||
var versionToCheck = new Version(version); | ||
|
||
return versionToCheck == currentVersion; | ||
} | ||
} | ||
} |
Oops, something went wrong.