public override Job2 NewJob(JobInvocationInfo specification)
        {
            if (specification == null)
            {
                throw new NullReferenceException("specification");
            }

            if (specification.Parameters.Count != 1)
            {
                throw new ArgumentException("JobInvocationInfo specification parameters not specified.");
            }

            // Retrieve source and destination path information from specification
            // parameters.
            string sourcePath      = null;
            string destinationPath = null;
            CommandParameterCollection parameters = specification.Parameters[0];

            foreach (var item in parameters)
            {
                if (item.Name.Equals(SourcePathProperty, StringComparison.OrdinalIgnoreCase))
                {
                    sourcePath = item.Value as string;
                }
                else if (item.Name.Equals(DestinationPathProperty, StringComparison.OrdinalIgnoreCase))
                {
                    destinationPath = item.Value as string;
                }
            }

            // Create FileCopyJob
            FileCopyJob rtnJob = new FileCopyJob(specification.Name, sourcePath, destinationPath);

            lock (JobRepository)
            {
                JobRepository.Add(rtnJob);
            }
            return(rtnJob);
        }
        public override Job2 NewJob(JobInvocationInfo specification)
        {
            if (specification == null)
            {
                throw new NullReferenceException("specification");
            }

            if (specification.Parameters.Count != 1)
            {
                throw new ArgumentException("JobInvocationInfo specification parameters not specified.");
            }

            // Retrieve source and destination path information from specification
            // parameters.
            string sourcePath = null;
            string destinationPath = null;
            CommandParameterCollection parameters = specification.Parameters[0];
            foreach (var item in parameters)
            {
                if (item.Name.Equals(SourcePathProperty, StringComparison.OrdinalIgnoreCase))
                {
                    sourcePath = item.Value as string;
                }
                else if (item.Name.Equals(DestinationPathProperty, StringComparison.OrdinalIgnoreCase))
                {
                    destinationPath = item.Value as string;
                }
            }

            // Create FileCopyJob
            FileCopyJob rtnJob = new FileCopyJob(specification.Name, sourcePath, destinationPath);
            lock (JobRepository)
            {
                JobRepository.Add(rtnJob);
            }
            return rtnJob;
        }