Exemple #1
0
        /// <summary>
        /// Checks if the object being passed in is the same directory as what this current object points to
        /// </summary>
        /// <param name="obj"></param>
        /// <returns>True if the two point to the same directory, false otherwise</returns>
        public override bool Equals(object obj) //TODO: At some inexplicable point, this method is called and a null object is passed in. I don't know why or how.
        {
            FilesToMove temp = obj as FilesToMove;

            if (temp != null)
            {
                return(temp.ToString() == this.ToString());
            }
            return(false);
        }
Exemple #2
0
        public int CompareTo(object obj)
        {
            FilesToMove temp = obj as FilesToMove;

            if (temp != null)
            {
                return(this.Directory.CompareTo(temp.GetDirectory()));
            }
            else
            {
                throw new ArgumentException("Invalid object passed");
            }
        }