Move Version from Definitions to Client

This commit is contained in:
Cyberboss
2017-12-08 14:58:18 -05:00
parent 827604f341
commit e0766b42e1
2 changed files with 7 additions and 8 deletions
+7 -3
View File
@@ -14,6 +14,11 @@ namespace TGS.Interface
/// <inheritdoc />
sealed public class Client : IClient
{
/// <summary>
/// Version of the <see cref="Client"/>
/// </summary>
public static readonly Version Version = Assembly.GetExecutingAssembly().GetName().Version;
/// <inheritdoc />
public IServer Server => server;
@@ -147,10 +152,9 @@ namespace TGS.Interface
/// <inheritdoc />
public bool VersionMismatch(out string errorMessage)
{
var version = Definitions.Version;
if (ServerVersion.Major != version.Major || ServerVersion.Minor != version.Minor || ServerVersion.Build != version.Build) //don't care about the patch level
if (ServerVersion.Major != Version.Major || ServerVersion.Minor != Version.Minor || ServerVersion.Build != Version.Build) //don't care about the patch level
{
errorMessage = String.Format("Version mismatch between interface version ({0}) and service version ({1}). Some functionality may crash this program.", version, ServerVersion);
errorMessage = String.Format("Version mismatch between interface version ({0}) and service version ({1}). Some functionality may crash this program.", Version, ServerVersion);
return true;
}
errorMessage = null;
-5
View File
@@ -28,10 +28,5 @@ namespace TGS.Interface
/// Base name of instance URLs
/// </summary>
public const string InstanceInterfaceName = MasterInterfaceName + "/Instance";
/// <summary>
/// Version of the interface
/// </summary>
public static readonly Version Version = Assembly.GetExecutingAssembly().GetName().Version;
}
}