Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 8519193

Browse files
committed
Add evaluation license restrictions
1 parent 62710c2 commit 8519193

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

src/ServiceStack.Text/Env.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ public static class Env
1010
{
1111
static Env()
1212
{
13+
LicenseUtils.AssertEvaluationLicense();
14+
1315
string platformName = null;
1416

1517
#if NETFX_CORE
@@ -77,4 +79,15 @@ public static string ReferenceAssembyPath
7779
set { referenceAssembyPath = value; }
7880
}
7981
}
82+
83+
public static class LicenseUtils
84+
{
85+
public static void AssertEvaluationLicense()
86+
{
87+
if (DateTime.UtcNow > new DateTime(2013, 12, 31))
88+
throw new Exception("The evaluation license for this software has expired. " +
89+
"See http://www.servicestack.net to upgrade to a valid license.");
90+
}
91+
}
92+
8093
}

src/ServiceStack.Text/Json/JsonReader.Generic.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ public static ParseStringDelegate GetParseFn()
6666

6767
public static object Parse(string value)
6868
{
69+
LicenseUtils.AssertEvaluationLicense();
70+
6971
if (ReadFn == null)
7072
{
7173
if (typeof(T).IsAbstract() || typeof(T).IsInterface())

src/ServiceStack.Text/Json/JsonWriter.Generic.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ static JsonWriter()
177177

178178
public static void WriteObject(TextWriter writer, object value)
179179
{
180+
LicenseUtils.AssertEvaluationLicense();
181+
180182
#if MONOTOUCH
181183
if (writer == null) return;
182184
#endif

0 commit comments

Comments
 (0)