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 { } } } }
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(); }
public static ArtificialKeys LoadFromFile(string path) { return(XmlProvider.ReadFromFile <ArtificialKeys>(path)); }
public DBSchema ApplyArtificialKeyFile(string xmlFile) { return(ApplyArtificialKeys(XmlProvider.ReadFromFile <ArtificialKeys>(xmlFile))); }