Exemple #1
0
        /// <summary>
        /// Determine whether two <seealso cref="PathModel"/> objects describe the same
        /// location/item in the file system or not.
        ///
        /// Method implements <seealso cref="IComparable{IPathModel}"/> interface.
        /// </summary>
        /// <param name="path"></param>
        /// <returns></returns>
        public int CompareTo(IPathModel path)
        {
            if (PathModel.Compare(this, path) == true)
            {
                return(0);
            }
            else
            {
                string spath    = PathModel.NormalizePath(path.Path);
                string thispath = PathModel.NormalizePath(this.Path);

                return(string.Compare(spath, thispath, true));
            }
        }
Exemple #2
0
        /// <summary>
        /// Determine whether two <seealso cref="PathModel"/> objects describe
        /// the same location/item in the file system or not.
        ///
        /// Method implements <seealso cref="System.Collections.IEqualityComparer"/> interface.
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <returns></returns>
        public new bool Equals(object x, object y)
        {
            if (x is IPathModel == false)
            {
                throw new System.ArgumentException("Object x does not implement IPathModel interface.");
            }

            if (y is IPathModel == false)
            {
                throw new System.ArgumentException("Object y does not implement IPathModel interface.");
            }

            return(PathModel.Compare(x as IPathModel, y as IPathModel));
        }
Exemple #3
0
 /// <summary>
 /// Determine whether two <seealso cref="PathModel"/> objects describe the same
 /// location/item in the file system or not.
 ///
 /// Method implements <seealso cref="IEquatable{IPathModel}"/> interface.
 /// </summary>
 /// <param name="other"></param>
 /// <returns></returns>
 public bool Equals(IPathModel other)
 {
     return(PathModel.Compare(this, other));
 }
Exemple #4
0
 /// <summary>
 /// Determine whether two <seealso cref="PathModel"/> objects
 /// describe the same location/item in the file system or not.
 ///
 /// Method implements <seealso cref="IEqualityComparer{IPathModel}"/> interface.
 /// </summary>
 /// <param name="x"></param>
 /// <param name="y"></param>
 /// <returns></returns>
 public bool Equals(IPathModel x, IPathModel y)
 {
     return(PathModel.Compare(x, y));
 }