예제 #1
0
파일: JobDetail.cs 프로젝트: jesumarquez/lt
        /// <summary>
        /// Creates a new object that is a copy of the current instance.
        /// </summary>
        /// <returns>
        /// A new object that is a copy of this instance.
        /// </returns>
        public virtual object Clone()
        {
            JobDetail copy;

            try
            {
                copy = (JobDetail)MemberwiseClone();
                copy.jobListeners = (HashSet)jobListeners.Clone();
                if (jobDataMap != null)
                {
                    copy.jobDataMap = (JobDataMap)jobDataMap.Clone();
                }
            }
            catch (Exception)
            {
                throw new Exception("Not Cloneable.");
            }

            return(copy);
        }
예제 #2
0
파일: Trigger.cs 프로젝트: jesumarquez/lt
        /// <summary>
        /// Creates a new object that is a copy of the current instance.
        /// </summary>
        /// <returns>
        /// A new object that is a copy of this instance.
        /// </returns>
        public virtual object Clone()
        {
            Trigger copy;

            try
            {
                copy = (Trigger)MemberwiseClone();

                copy.triggerListeners = (ArrayList)triggerListeners.Clone();

                // Shallow copy the jobDataMap.  Note that this means that if a user
                // modifies a value object in this map from the cloned Trigger
                // they will also be modifying this Trigger.
                if (jobDataMap != null)
                {
                    copy.jobDataMap = (JobDataMap)jobDataMap.Clone();
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Not Cloneable.", ex);
            }
            return(copy);
        }