/// <summary>
 /// Initializes a new instance of the <see cref="ReferenceDirectorySource"/> class
 /// with parameters copied from the specified instance of the
 /// <see cref="ReferenceDirectorySource"/> class, a copy constructor.
 /// </summary>
 /// <param name="source">
 /// An instance of the <see cref="ReferenceDirectorySource"/> class from which the
 /// initialization parameters or values will be copied.
 /// </param>
 /// <exception cref="ArgumentNullException">
 /// If the parameter <paramref name="source"/> is <see langword="null"/>.
 /// </exception>
 public ReferenceDirectorySource(ReferenceDirectorySource source)
     : base(source)
 {
     _excludeSet    = source._excludeSet;
     _sourcePath    = source._sourcePath;
     _isRecursive   = source._isRecursive;
     _searchPattern = source._searchPattern;
     _frameworkType = source._frameworkType;
 }
        public override ReferenceSource Clone()
        {
            ReferenceDirectorySource source = new ReferenceDirectorySource(this);

            this.Clone(source);

            if (_searchPattern != null)
            {
                source._searchPattern = String.Copy(_searchPattern);
            }
            if (_sourcePath != null)
            {
                source._sourcePath = _sourcePath.Clone();
            }
            if (_excludeSet != null)
            {
                source._excludeSet = new HashSet <string>(_excludeSet);
            }

            return(source);
        }