Пример #1
0
 public override void OnCompleted()
 {
     try {
         // apply license verification
         UnderlyingJob.Complete();
         if (File.Exists(LocalFileName))
         {
             var command = XmlProvider.ReadFromFile <ProductLicenseCommand>(
                 LocalFileName,
                 Encoding.ASCII
                 );
             LicenseServices.RegisterLicenseOverrideCommand(command);
             if (CommandDownloaded != null)
             {
                 CommandDownloaded(this, new BITSLicenseCommandDownloadEvent {
                     Command = command
                 });
             }
         }
     } catch {
         // ServicesProvider.ReportError(error);
     } finally {
         if (File.Exists(LocalFileName))
         {
             try {
                 File.Delete(LocalFileName);
             } catch {
             }
         }
     }
 }
Пример #2
0
 public virtual void VerifyLicense()
 {
     Tools.Lambda
     .Action(() => {
         using (var wc = new WebClient()) {
             ApplyLicenseCommand(
                 XmlProvider.ReadFromFile <ProductLicenseCommand>(
                     wc.DownloadString(GenerateVerificationUrl()),
                     Encoding.ASCII
                     )
                 );
         }
     })
     .WithRetry(
         3,
         (attempt, error) => {
         // Log error here
         Thread.Sleep(TimeSpan.FromMinutes(attempt));
     }
         )
     .AsAsyncronous()
     .IgnoringExceptions()
     .Invoke();
 }
Пример #3
0
 public static ArtificialKeys LoadFromFile(string path)
 {
     return(XmlProvider.ReadFromFile <ArtificialKeys>(path));
 }
Пример #4
0
 public DBSchema ApplyArtificialKeyFile(string xmlFile)
 {
     return(ApplyArtificialKeys(XmlProvider.ReadFromFile <ArtificialKeys>(xmlFile)));
 }