Beispiel #1
0
        /// <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);
        }
Beispiel #2
0
        /// <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);
        }