/// <summary> /// Initializes a new instance of the RestoreTask class. /// </summary> /// <param name="target">The restore target to execute.</param> public RestoreTask(DatabaseRestoreTargetConfigurationElement target) : base(SThreeQLConfiguration.Section.AwsTargets[target.AwsBucketName]) { this.Target = target; }
private static void ExecuteRestore(DatabaseRestoreTargetConfigurationElement target) { try { RestoreTask task = new RestoreTask(target); task.DecompressComplete += new EventHandler<RestoreDatabaseTargetEventArgs>(RestoreDecompressComplete); task.DecompressStart += new EventHandler<RestoreDatabaseTargetEventArgs>(RestoreDecompressStart); task.RestoreComplete += new EventHandler<RestoreDatabaseTargetEventArgs>(RestoreComplete); task.RestoreStart += new EventHandler<RestoreDatabaseTargetEventArgs>(RestoreStart); task.TransferComplete += new EventHandler<RestoreDatabaseTargetEventArgs>(RestoreTransferComplete); task.TransferProgress += new EventHandler<RestoreDatabaseTargetEventArgs>(RestoreTransferProgress); task.TransferStart += new EventHandler<RestoreDatabaseTargetEventArgs>(RestoreTransferStart); var result = task.Execute(); if (!result.Success) { WriteError(result.Exception); } } catch (Exception ex) { WriteError(ex); } }