-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBaseApp.cs
55 lines (48 loc) · 2.03 KB
/
BaseApp.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using QuantumConcepts.Common.Utils;
using System.Security.Cryptography;
namespace QuantumConcepts.Common
{
public abstract class BaseApp
{
public static string ApplicationTitle { get { return Application.ProductName; } }
public static Version Version { get { return new Version(Application.ProductVersion); } }
public static string ApplicationKey { get; private set; }
public static string ApiKey { get { return "8mwUZMowWlPaGQC07kKZbrHRKxZ7RJ0kSOGjGx6eGo0="; } }
public static string ApiSecret { get { return "6TzPoMNhQnUj7GUsnkBNOQ=="; } }
public static string Url { get; private set; }
public static string TrialLimitations { get; set; }
public static string DeviceUniqueID
{
get
{
StringBuilder id = new StringBuilder();
KeyValuePair<string, object>? key = null;
if ((key = WMIUtil.Search(WMIUtil.Processor, "ProcessorId")).HasValue)
id.Append(key.Value.Value);
if ((key = WMIUtil.Search(WMIUtil.BIOS, "Manufacturer")).HasValue)
id.Append(key.Value.Value);
return id.ToString();
}
}
public static bool IsTrial { get; private set; }
public static DateTime ValidFrom { get; private set; }
public static DateTime? ExpirationDate { get; private set; }
public static void Initialize(string applicationKey, string url, string trialLimitations)
{
BaseApp.ApplicationKey = applicationKey;
BaseApp.Url = url;
BaseApp.TrialLimitations = trialLimitations;
}
public static void InitializeActivationData(bool isTrial, DateTime validFrom, DateTime? expirationDate)
{
BaseApp.IsTrial = isTrial;
BaseApp.ValidFrom = validFrom;
BaseApp.ExpirationDate = expirationDate;
}
}
}