示例#1
0
        /// <summary>
        /// Copies the specified source.
        /// </summary>
        /// <param name="source">The source.</param>
        /// <param name="destination">The destination.</param>
        /// <returns></returns>
        public static TaskDosCommand Copy(TaskDosCommand source, TaskDosCommand 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.DosExecutable           = source.DosExecutable;
            destination.Parameters              = source.Parameters;
            destination.AfterTaskPauseInSeconds = source.AfterTaskPauseInSeconds;
            destination.RunAsUser     = source.RunAsUser;
            destination.RunAsPassword = source.RunAsPassword;

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

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

            TaskDosCommand newTask = new TaskDosCommand();

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

            // Subclass
            newTask.DosExecutable = legacyTask.DosExecutable;
            newTask.Parameters    = legacyTask.Parameters;
            newTask.RunAsUser     = null;
            newTask.RunAsPassword = null;

            return(newTask);
        }
示例#3
0
        /// <summary>
        /// Creates a new instance of <see cref="TaskDosCommand"/>, setting all of the properties to equal
        /// the values of this instance.
        /// </summary>
        /// <returns></returns>
        public TaskDosCommand CreateCopyFromThis()
        {
            TaskDosCommand newTaskDosCommand = new TaskDosCommand();

            return(Copy(this, newTaskDosCommand));
        }