Index: DamClients/DamLive/trunk/src/Deltares.Dam.Application.Live/Program.cs =================================================================== diff -u -r2350 -r2599 --- DamClients/DamLive/trunk/src/Deltares.Dam.Application.Live/Program.cs (.../Program.cs) (revision 2350) +++ DamClients/DamLive/trunk/src/Deltares.Dam.Application.Live/Program.cs (.../Program.cs) (revision 2599) @@ -22,36 +22,29 @@ using System; using System.IO; using CommandLine; -using Deltares.Authorization; using Deltares.Dam.Data; +using Deltares.Dam.Data.License; using Deltares.Standard.Application; +using Deltares.Standard.Reflection; using log4net.Config; namespace Deltares.Dam.Application.Live { internal class Program { - internal readonly static LogHelper Logger = LogHelper.Create("DamLive"); + internal static readonly LogHelper Logger = LogHelper.Create("DamLive"); + static readonly AssemblyInfoHelper info = new AssemblyInfoHelper(typeof(Program)); - private static DAuthClient dAuthClient; private const string dAuthFeature = "DGS_27_00"; - private const string dAuthVersion = "17.0"; static void Main(string[] args) { - var damLicenseType = DamLicenseType.None; - - // new authorization client ? - dAuthClient = new DAuthClient(false, true); - if (dAuthClient.CheckOut(dAuthFeature, dAuthVersion)) - { - damLicenseType = DamLicenseType.LFM; - } + DamLicense.CheckoutLicense(dAuthFeature, info.AssemblyVersion); XmlConfigurator.Configure(); try { - if (damLicenseType == DamLicenseType.None) + if (DamLicense.DamLicenseType == DamLicenseType.None) { throw new Exception("No license found for DamLive"); } @@ -62,15 +55,9 @@ Console.WriteLine(); Logger.LogFatal("There was an unexpected error. Program terminated", e); } + + DamLicense.CheckinLicense(); - // check in license - if (dAuthClient != null) - { - dAuthClient.CheckIn(dAuthFeature); - dAuthClient.Dispose(); - dAuthClient = null; - } - //Console.ReadKey(); }