private int subtaskCount; // the subtask count /// <summary> /// Initializes a new instance of the class. /// </summary> public ProgressTracker(ITransferControl transferControl) { this.transferControl = transferControl ?? throw new ArgumentNullException(nameof(transferControl)); taskIndex = 0; taskCount = 0; subtaskIndex = 0; subtaskCount = 0; }
/// <summary> /// Initializes a new instance of the class. /// </summary> public ServiceStarter(IAgentClient agentClient, ProjectInstance instance, UploadOptions uploadOptions, ITransferControl transferControl, ProgressTracker progressTracker) { this.agentClient = agentClient ?? throw new ArgumentNullException(nameof(agentClient)); this.instance = instance ?? throw new ArgumentNullException(nameof(instance)); this.uploadOptions = uploadOptions ?? throw new ArgumentNullException(nameof(uploadOptions)); this.transferControl = transferControl ?? throw new ArgumentNullException(nameof(transferControl)); this.progressTracker = progressTracker ?? throw new ArgumentNullException(nameof(progressTracker)); ProcessTimeout = 0; }
/// <summary> /// Initializes a new instance of the class. /// </summary> public Uploader(ScadaProject project, ProjectInstance instance, DeploymentProfile profile, ITransferControl transferControl) { this.project = project ?? throw new ArgumentNullException(nameof(project)); this.instance = instance ?? throw new ArgumentNullException(nameof(instance)); this.profile = profile ?? throw new ArgumentNullException(nameof(profile)); this.transferControl = transferControl ?? throw new ArgumentNullException(nameof(transferControl)); uploadOptions = profile.UploadOptions; progressTracker = new ProgressTracker(transferControl) { TaskCount = TaskCount }; conn = null; }
/// <summary> /// Initializes a new instance of the class. /// </summary> public Downloader(AdminDirs appDirs, ScadaProject project, ProjectInstance instance, DeploymentProfile profile, ITransferControl transferControl) { this.appDirs = appDirs ?? throw new ArgumentNullException(nameof(appDirs)); this.project = project ?? throw new ArgumentNullException(nameof(project)); this.instance = instance ?? throw new ArgumentNullException(nameof(instance)); this.profile = profile ?? throw new ArgumentNullException(nameof(profile)); this.transferControl = transferControl ?? throw new ArgumentNullException(nameof(transferControl)); downloadOptions = profile.DownloadOptions; progressTracker = new ProgressTracker(transferControl) { TaskCount = TaskCount }; agentClient = null; tempFileNames = null; extractDirs = null; }
/// <summary> /// Uploads the configuration. /// </summary> public override void UploadConfig(ScadaProject project, ProjectInstance instance, DeploymentProfile profile, ITransferControl transferControl) { new Uploader(project, instance, profile, transferControl).Upload(); }
/// <summary> /// Downloads the configuration. /// </summary> public override void DownloadConfig(ScadaProject project, ProjectInstance instance, DeploymentProfile profile, ITransferControl transferControl) { new Downloader(AdminContext.AppDirs, project, instance, profile, transferControl).Download(); }
/// <summary> /// Uploads the configuration. /// </summary> public virtual void UploadConfig(ScadaProject project, ProjectInstance instance, DeploymentProfile profile, ITransferControl transferControl) { throw new ScadaException(CommonPhrases.OperationNotSupported); }