Skip to content

Commit

Permalink
Make provision for Trial licences
Browse files Browse the repository at this point in the history
  • Loading branch information
sjh37 committed Nov 23, 2019
1 parent cef2040 commit f2b032a
Show file tree
Hide file tree
Showing 11 changed files with 98 additions and 14 deletions.
Binary file not shown.
Binary file not shown.
Binary file modified EntityFramework Reverse POCO Generator/ItemTemplates/efrpoco.zip
Binary file not shown.
14 changes: 12 additions & 2 deletions EntityFramework Reverse POCO Generator/license.txt
Expand Up @@ -234,7 +234,17 @@ WITH YOUR PURCHASE OR USE OF A LICENSE FOR USE OF THE REVERSE POCO MATERIALS.
may only use the licence key provided to them and not allow access to or permit the use of such
access key to any other individuals. Any use of the Licence Material must be used for Academic /
Non-Commercial purposes only. No programs developed utilised under this licence type maybe
distributed for any reason other than Academic / Non-Commercial purposes.
distributed for any reason other than Academic / Non-Commercial purposes.

7.3 Evaluation, Demonstration or Trial
If a Licensee is granted an "evaluation" "demonstration" "trial" licence for the material then the
Licensee may install a single, primary copy of the Licence Materials on one computer or server and
allow access to the primary copy of the licence material solely by the Licensee. Licensee may install
one copy of the Licenced Material on a single computer or server accessible only by the Licensee. The
Licenced Material may be used solely for the Licensee's personal use such as evaluation of the
Licensed Material. This licensed type will be for a fixed term based on the determination of REVERSE
POCO or if no such term as specified, the term is seven (7) days from installation or as otherwise
authorised in writing by REVERSE POCO.

8. Term and Termination

Expand All @@ -243,7 +253,7 @@ WITH YOUR PURCHASE OR USE OF A LICENSE FOR USE OF THE REVERSE POCO MATERIALS.
by this Agreement, will become effective as of the latest to occur of:
(a) this Agreement becoming effective; or
(b) payment by Licensee of the applicable fees, excluding licences (such as
academic licences) where no fees are required; or
academic / trial licences) where no fees are required; or
(c) delivery of the specific Licensed Materials.

8.2
Expand Down
Expand Up @@ -3378,6 +3378,7 @@

private DbProviderFactory _factory;
public bool HasAcademicLicence;
public bool HasTrialLicence;
private readonly StringBuilder _preHeaderInfo;
private readonly string _codeGeneratedAttribute;
private readonly FileManagementService _fileManagementService;
Expand Down Expand Up @@ -3430,6 +3431,7 @@
_preHeaderInfo.Append(DatabaseDetails());

HasAcademicLicence = licence.LicenceType == LicenceType.Academic;
HasTrialLicence = licence.LicenceType == LicenceType.Trial;
InitialisationOk = FilterList.ReadDbContextSettings(DatabaseReader, singleDbContextSubNamespace);
_fileManagementService.Init(FilterList.GetFilters(), _fileManagerType);
}
Expand Down Expand Up @@ -3890,6 +3892,8 @@

if (HasAcademicLicence)
filter.Tables.TrimForAcademicLicence();
if (HasTrialLicence)
filter.Tables.TrimForTrialLicence();
}
}

Expand Down Expand Up @@ -3994,10 +3998,16 @@
{
if (!filter.IsExcluded(sp))
{
if(HasAcademicLicence)
if (HasAcademicLicence)
{
const int n = 2 * 2;
if(filter.StoredProcs.Count < n)
if (filter.StoredProcs.Count < n)
filter.StoredProcs.Add(sp);
}
else if (HasTrialLicence)
{
const int n = 1;
if (filter.StoredProcs.Count < n)
filter.StoredProcs.Add(sp);
}
else
Expand Down Expand Up @@ -14591,12 +14601,24 @@ SELECT SERVERPROPERTY('Edition') AS Edition,
{
// Mapping tables do not count
const int n = 2 * 2 * 2 * 2;
TrimForLicence(n);
}

public void TrimForTrialLicence()
{
// Mapping tables do not count
const int n = 1 + 1 + 1 + 1 + 1;
TrimForLicence(n);
}

private void TrimForLicence(int n)
{
if (this.Count(x => !x.IsMapping) <= n)
return;

RemoveAll(x => !x.HasPrimaryKey);

while(this.Count(x => !x.IsMapping) > n)
while (this.Count(x => !x.IsMapping) > n)
{
try
{
Expand Down
14 changes: 12 additions & 2 deletions EntityFramework.Reverse.POCO.Generator/license.txt
Expand Up @@ -234,7 +234,17 @@ WITH YOUR PURCHASE OR USE OF A LICENSE FOR USE OF THE REVERSE POCO MATERIALS.
may only use the licence key provided to them and not allow access to or permit the use of such
access key to any other individuals. Any use of the Licence Material must be used for Academic /
Non-Commercial purposes only. No programs developed utilised under this licence type maybe
distributed for any reason other than Academic / Non-Commercial purposes.
distributed for any reason other than Academic / Non-Commercial purposes.

7.3 Evaluation, Demonstration or Trial
If a Licensee is granted an "evaluation" "demonstration" "trial" licence for the material then the
Licensee may install a single, primary copy of the Licence Materials on one computer or server and
allow access to the primary copy of the licence material solely by the Licensee. Licensee may install
one copy of the Licenced Material on a single computer or server accessible only by the Licensee. The
Licenced Material may be used solely for the Licensee's personal use such as evaluation of the
Licensed Material. This licensed type will be for a fixed term based on the determination of REVERSE
POCO or if no such term as specified, the term is seven (7) days from installation or as otherwise
authorised in writing by REVERSE POCO.

8. Term and Termination

Expand All @@ -243,7 +253,7 @@ WITH YOUR PURCHASE OR USE OF A LICENSE FOR USE OF THE REVERSE POCO MATERIALS.
by this Agreement, will become effective as of the latest to occur of:
(a) this Agreement becoming effective; or
(b) payment by Licensee of the applicable fees, excluding licences (such as
academic licences) where no fees are required; or
academic / trial licences) where no fees are required; or
(c) delivery of the specific Licensed Materials.

8.2
Expand Down
14 changes: 12 additions & 2 deletions Generator/Generators/Generator.cs
Expand Up @@ -39,6 +39,7 @@ public abstract class Generator

private DbProviderFactory _factory;
public bool HasAcademicLicence;
public bool HasTrialLicence;
private readonly StringBuilder _preHeaderInfo;
private readonly string _codeGeneratedAttribute;
private readonly FileManagementService _fileManagementService;
Expand Down Expand Up @@ -91,6 +92,7 @@ public void Init(string singleDbContextSubNamespace)
_preHeaderInfo.Append(DatabaseDetails());

HasAcademicLicence = licence.LicenceType == LicenceType.Academic;
HasTrialLicence = licence.LicenceType == LicenceType.Trial;
InitialisationOk = FilterList.ReadDbContextSettings(DatabaseReader, singleDbContextSubNamespace);
_fileManagementService.Init(FilterList.GetFilters(), _fileManagerType);
}
Expand Down Expand Up @@ -551,6 +553,8 @@ private void SetPrimaryKeys()

if (HasAcademicLicence)
filter.Tables.TrimForAcademicLicence();
if (HasTrialLicence)
filter.Tables.TrimForTrialLicence();
}
}

Expand Down Expand Up @@ -655,10 +659,16 @@ public void LoadStoredProcs()
{
if (!filter.IsExcluded(sp))
{
if(HasAcademicLicence)
if (HasAcademicLicence)
{
const int n = 2 * 2;
if(filter.StoredProcs.Count < n)
if (filter.StoredProcs.Count < n)
filter.StoredProcs.Add(sp);
}
else if (HasTrialLicence)
{
const int n = 1;
if (filter.StoredProcs.Count < n)
filter.StoredProcs.Add(sp);
}
else
Expand Down
14 changes: 13 additions & 1 deletion Generator/Tables.cs
Expand Up @@ -33,12 +33,24 @@ public void TrimForAcademicLicence()
{
// Mapping tables do not count
const int n = 2 * 2 * 2 * 2;
TrimForLicence(n);
}

public void TrimForTrialLicence()
{
// Mapping tables do not count
const int n = 1 + 1 + 1 + 1 + 1;
TrimForLicence(n);
}

private void TrimForLicence(int n)
{
if (this.Count(x => !x.IsMapping) <= n)
return;

RemoveAll(x => !x.HasPrimaryKey);

while(this.Count(x => !x.IsMapping) > n)
while (this.Count(x => !x.IsMapping) > n)
{
try
{
Expand Down
Binary file modified ItemTemplate/ItemTemplates/efrpoco.zip
Binary file not shown.
14 changes: 12 additions & 2 deletions ItemTemplate/license.txt
Expand Up @@ -234,7 +234,17 @@ WITH YOUR PURCHASE OR USE OF A LICENSE FOR USE OF THE REVERSE POCO MATERIALS.
may only use the licence key provided to them and not allow access to or permit the use of such
access key to any other individuals. Any use of the Licence Material must be used for Academic /
Non-Commercial purposes only. No programs developed utilised under this licence type maybe
distributed for any reason other than Academic / Non-Commercial purposes.
distributed for any reason other than Academic / Non-Commercial purposes.

7.3 Evaluation, Demonstration or Trial
If a Licensee is granted an "evaluation" "demonstration" "trial" licence for the material then the
Licensee may install a single, primary copy of the Licence Materials on one computer or server and
allow access to the primary copy of the licence material solely by the Licensee. Licensee may install
one copy of the Licenced Material on a single computer or server accessible only by the Licensee. The
Licenced Material may be used solely for the Licensee's personal use such as evaluation of the
Licensed Material. This licensed type will be for a fixed term based on the determination of REVERSE
POCO or if no such term as specified, the term is seven (7) days from installation or as otherwise
authorised in writing by REVERSE POCO.

8. Term and Termination

Expand All @@ -243,7 +253,7 @@ WITH YOUR PURCHASE OR USE OF A LICENSE FOR USE OF THE REVERSE POCO MATERIALS.
by this Agreement, will become effective as of the latest to occur of:
(a) this Agreement becoming effective; or
(b) payment by Licensee of the applicable fees, excluding licences (such as
academic licences) where no fees are required; or
academic / trial licences) where no fees are required; or
(c) delivery of the specific Licensed Materials.

8.2
Expand Down
14 changes: 12 additions & 2 deletions LICENSE
Expand Up @@ -234,7 +234,17 @@ WITH YOUR PURCHASE OR USE OF A LICENSE FOR USE OF THE REVERSE POCO MATERIALS.
may only use the licence key provided to them and not allow access to or permit the use of such
access key to any other individuals. Any use of the Licence Material must be used for Academic /
Non-Commercial purposes only. No programs developed utilised under this licence type maybe
distributed for any reason other than Academic / Non-Commercial purposes.
distributed for any reason other than Academic / Non-Commercial purposes.

7.3 Evaluation, Demonstration or Trial
If a Licensee is granted an "evaluation" "demonstration" "trial" licence for the material then the
Licensee may install a single, primary copy of the Licence Materials on one computer or server and
allow access to the primary copy of the licence material solely by the Licensee. Licensee may install
one copy of the Licenced Material on a single computer or server accessible only by the Licensee. The
Licenced Material may be used solely for the Licensee's personal use such as evaluation of the
Licensed Material. This licensed type will be for a fixed term based on the determination of REVERSE
POCO or if no such term as specified, the term is seven (7) days from installation or as otherwise
authorised in writing by REVERSE POCO.

8. Term and Termination

Expand All @@ -243,7 +253,7 @@ WITH YOUR PURCHASE OR USE OF A LICENSE FOR USE OF THE REVERSE POCO MATERIALS.
by this Agreement, will become effective as of the latest to occur of:
(a) this Agreement becoming effective; or
(b) payment by Licensee of the applicable fees, excluding licences (such as
academic licences) where no fees are required; or
academic / trial licences) where no fees are required; or
(c) delivery of the specific Licensed Materials.

8.2
Expand Down

0 comments on commit f2b032a

Please sign in to comment.