Index: DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/License/DamLicense.cs
===================================================================
diff -u -r2089 -r2598
--- DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/License/DamLicense.cs (.../DamLicense.cs) (revision 2089)
+++ DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/License/DamLicense.cs (.../DamLicense.cs) (revision 2598)
@@ -32,7 +32,6 @@
///
public class DamLicense
{
- private const string dAuthFeature = "DGS_26_00";
private static DAuthClient dAuthClient;
private static DamLicenseType damLicenseType = DamLicenseType.None;
@@ -57,9 +56,12 @@
/// Look up all features starting with the specified string
/// See if any of them has the correct license version, according to the version we get from the Application version info
///
- public static void CheckoutLicense(string version)
+ /// The feature.
+ /// The version.
+ public static void CheckoutLicense(string feature, string version)
{
- IEnumerable featureNames = GetAllFeaturesStartingWith(dAuthFeature);
+ if (feature == null) throw new ArgumentNullException(nameof(feature));
+ IEnumerable featureNames = GetAllFeaturesStartingWith(feature);
if (featureNames == null)
{
checkedOutFeature = null;
Index: DamClients/DamUI/trunk/src/Dam/Application/Program.cs
===================================================================
diff -u -r2088 -r2598
--- DamClients/DamUI/trunk/src/Dam/Application/Program.cs (.../Program.cs) (revision 2088)
+++ DamClients/DamUI/trunk/src/Dam/Application/Program.cs (.../Program.cs) (revision 2598)
@@ -35,6 +35,7 @@
{
internal class Program : IProgramInfo
{
+ private const string dAuthFeature = "DGS_26_00";
private const string BetaString = "(BETA)";
// ReSharper disable ConvertToConstant.Local
@@ -111,7 +112,7 @@
private static void Start()
{
- DamLicense.CheckoutLicense(info.AssemblyVersion);
+ DamLicense.CheckoutLicense(dAuthFeature, info.AssemblyVersion);
// Parameters are used for splash screen
var mainForm = new MainForm(typeof(Program),
Index: DamClients/DamUI/trunk/src/Dam/Tests/License/LicenseTest.cs
===================================================================
diff -u -r875 -r2598
--- DamClients/DamUI/trunk/src/Dam/Tests/License/LicenseTest.cs (.../branches/CalcualtionIncluded/src/Dam/Tests/License/LicenseTest.cs) (revision 875)
+++ DamClients/DamUI/trunk/src/Dam/Tests/License/LicenseTest.cs (.../trunk/src/Dam/Tests/License/LicenseTest.cs) (revision 2598)
@@ -1,4 +1,25 @@
-using System.Linq;
+// Copyright (C) Stichting Deltares 2018. All rights reserved.
+//
+// This file is part of the application DAM - UI.
+//
+// DAM - UI is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System.Linq;
using Deltares.Dam.Data;
using Deltares.Dam.Data.License;
using NUnit.Framework;
@@ -15,7 +36,7 @@
public void CanCheckout()
{
// Only major version is relevant
- DamLicense.CheckoutLicense("17.1.1.1");
+ DamLicense.CheckoutLicense(dAuthFeature, "17.1.1.1");
Assert.IsTrue(DamLicense.DamLicenseType == DamLicenseType.LFM);