/// <summary>
 /// Get registration information for a given feature and version.  Will return a MBRegistrationRecord instance.
 /// The return will be immediate, but the registration status will be filled in asynchronously.  The 'RegChecked'
 /// attribute of the returned record will be set to true when validation is finished.  'RegError' is set to true
 /// if an error is encountered.
 /// </summary>
 /// <param name="feature"></param>
 /// <param name="version"></param>
 /// <returns>A MBRegistrationRecord (filled in asynchronously)</returns>
 public static MBRegistrationRecord GetRegistrationStatus(string feature, System.Version version)
 {
     MBRegistrationRecord rec = new MBRegistrationRecord();
     Async.Queue(feature + " registration check", () =>
     {
         try
         {
             rec.ExpirationDate = GetExpirationDate(feature, version);
             rec.IsRegistered = Validate(feature);
         }
         catch
         {
             //we reported on the error in the routine that caused it.  Just mark our record.
             rec.RegError = true;
         }
         rec.RegChecked = true;
     });
     return rec;
 }
Beispiel #2
0
        /// <summary>
        /// Get registration information for a given feature and version.  Will return a MBRegistrationRecord instance.
        /// The return will be immediate, but the registration status will be filled in asynchronously.  The 'RegChecked'
        /// attribute of the returned record will be set to true when validation is finished.  'RegError' is set to true
        /// if an error is encountered.
        /// </summary>
        /// <param name="feature"></param>
        /// <param name="version"></param>
        /// <returns>A MBRegistrationRecord (filled in asynchronously)</returns>
        public static MBRegistrationRecord GetRegistrationStatus(string feature, System.Version version)
        {
            MBRegistrationRecord rec = new MBRegistrationRecord();

            Async.Queue(feature + " registration check", () =>
            {
                try
                {
                    rec.ExpirationDate = GetExpirationDate(feature, version);
                    rec.IsRegistered   = Validate(feature);
                }
                catch
                {
                    //we reported on the error in the routine that caused it.  Just mark our record.
                    rec.RegError = true;
                }
                rec.RegChecked = true;
            });
            return(rec);
        }
 /// <summary>
 /// Get registration information for a given feature and version.  Will return a MBRegistrationRecord instance.
 /// The return will be immediate, but the registration status will be filled in asynchronously.  The 'RegChecked'
 /// attribute of the returned record will be set to true when validation is finished.  'RegError' is set to true
 /// if an error is encountered.
 /// </summary>
 /// <param name="feature"></param>
 /// <param name="version"></param>
 /// <returns>A MBRegistrationRecord (filled in asynchronously)</returns>
 public static MBRegistrationRecord GetRegistrationStatus(string feature, System.Version version)
 {
     
     var rec = new MBRegistrationRecord();
     Async.Queue(Async.ThreadPoolName.MBRegistration, () => //feature + " registration check", () =>
     {
         try
         {
             var mb3Rec = Kernel.ApiClient.GetRegistrationStatus(feature, feature); // pass our feature as the MB2 Equiv
             rec.ExpirationDate = mb3Rec.ExpirationDate;
             rec.IsRegistered = mb3Rec.IsRegistered;
         }
         catch
         {
             //we reported on the error in the routine that caused it.  Just mark our record.
             rec.RegError = true;
         }
         rec.RegChecked = true;
     });
     return rec;
 }
Beispiel #4
0
        /// <summary>
        /// Get registration information for a given feature and version.  Will return a MBRegistrationRecord instance.
        /// The return will be immediate, but the registration status will be filled in asynchronously.  The 'RegChecked'
        /// attribute of the returned record will be set to true when validation is finished.  'RegError' is set to true
        /// if an error is encountered.
        /// </summary>
        /// <param name="feature"></param>
        /// <param name="version"></param>
        /// <returns>A MBRegistrationRecord (filled in asynchronously)</returns>
        public static MBRegistrationRecord GetRegistrationStatus(string feature, System.Version version)
        {
            var rec = new MBRegistrationRecord();

            Async.Queue(feature + " registration check", () =>
            {
                try
                {
                    var mb3Rec         = Kernel.ApiClient.GetRegistrationStatus(feature, feature); // pass our feature as the MB2 Equiv
                    rec.ExpirationDate = mb3Rec.ExpirationDate;
                    rec.IsRegistered   = mb3Rec.IsRegistered;
                }
                catch
                {
                    //we reported on the error in the routine that caused it.  Just mark our record.
                    rec.RegError = true;
                }
                rec.RegChecked = true;
            });
            return(rec);
        }