Example #1
0
 public string ParseLicenseKey(string text64)
 {
     //LicenseKey is:
     // During trial periods, it contains an expiry date.
     // After payment honored, it changes to GUID. So,...
     try{
         Guid guid = new Guid(text64);
         foreach (KeyValuePair <string, ActivationSet> item in actCache)
         {
             if (guid == item.Value.Id)
             {
                 string xml = ActivationSet.ToXmlString(item.Value);
                 return(xml);
             }
         }
     }catch (Exception) {}
     using (LicenseGenerator Lg = new LicenseGenerator()) {
         string   text = Lg.ParseLicenseKey(text64);
         DateTime trialExpiry;
         bool     isDateTime = DateTime.TryParse(text, out trialExpiry);
         if (isDateTime)
         {
             return(text);
         }
     }
     return(String.Empty);
 }
Example #2
0
 public string GetActivationSet(string key)
 {
     lock (actCache){
         if (actCache.ContainsKey(key.ToUpper()))
         {
             ActivationSet item = actCache[key.ToUpper()];
             return(item.ToXmlString());
         }
     }
     return(null);
 }
Example #3
0
 public string ToXmlString()
 {
     return(ActivationSet.ToXmlString(this));
 }