예제 #1
0
        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;
        }
예제 #2
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;
 }
예제 #3
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;
 }
예제 #4
0
        /// <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;
        }
예제 #5
0
 /// <summary>
 /// Uploads the configuration.
 /// </summary>
 public override void UploadConfig(ScadaProject project, ProjectInstance instance, DeploymentProfile profile,
                                   ITransferControl transferControl)
 {
     new Uploader(project, instance, profile, transferControl).Upload();
 }
예제 #6
0
 /// <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();
 }
예제 #7
0
 /// <summary>
 /// Uploads the configuration.
 /// </summary>
 public virtual void UploadConfig(ScadaProject project, ProjectInstance instance, DeploymentProfile profile,
                                  ITransferControl transferControl)
 {
     throw new ScadaException(CommonPhrases.OperationNotSupported);
 }