Beispiel #1
0
        /// <summary>
        /// Creates the new from legacy task.
        /// </summary>
        /// <param name="legacyTaskBase">The legacy task base.</param>
        /// <returns></returns>
        public static TaskCopyFile CreateNewFromLegacyTask(PrestoCommon.Entities.LegacyPresto.LegacyTaskBase legacyTaskBase)
        {
            if (legacyTaskBase == null)
            {
                throw new ArgumentNullException("legacyTaskBase");
            }

            PrestoCommon.Entities.LegacyPresto.LegacyTaskCopyFile legacyTask = legacyTaskBase as PrestoCommon.Entities.LegacyPresto.LegacyTaskCopyFile;

            TaskCopyFile newTask = new TaskCopyFile();

            // Base class
            newTask.Description          = legacyTask.Description;
            newTask.FailureCausesAllStop = legacyTask.FailureCausesAllStop;
            newTask.Sequence             = 0;
            newTask.TaskSucceeded        = false;
            newTask.PrestoTaskType       = TaskType.CopyFile;

            // Subclass
            newTask.DestinationPath = legacyTask.DestinationPath;
            newTask.SourceFileName  = legacyTask.SourceFileName;
            newTask.SourcePath      = legacyTask.SourcePath;

            return(newTask);
        }
Beispiel #2
0
        /// <summary>
        /// Copies the specified source.
        /// </summary>
        /// <param name="source">The source.</param>
        /// <param name="destination">The destination.</param>
        /// <returns></returns>
        public static TaskCopyFile Copy(TaskCopyFile source, TaskCopyFile destination)
        {
            if (source == null)
            {
                return(null);
            }

            if (destination == null)
            {
                throw new ArgumentNullException("destination");
            }

            // Base class
            destination.Description          = source.Description;
            destination.FailureCausesAllStop = source.FailureCausesAllStop;
            destination.Sequence             = source.Sequence;
            destination.TaskSucceeded        = source.TaskSucceeded;
            destination.PrestoTaskType       = source.PrestoTaskType;

            // Subclass
            destination.DestinationPath = source.DestinationPath;
            destination.SourceFileName  = source.SourceFileName;
            destination.SourcePath      = source.SourcePath;

            return(destination);
        }
Beispiel #3
0
        /// <summary>
        /// Creates the copy from this.
        /// </summary>
        /// <returns></returns>
        public TaskCopyFile CreateCopyFromThis()
        {
            TaskCopyFile newTaskCopyFile = new TaskCopyFile();

            return(Copy(this, newTaskCopyFile));
        }