/// <summary>
		/// Compares the specified one.
		/// </summary>
		/// <param name="one">The one.</param>
		/// <param name="two">The two.</param>
		/// <returns></returns>
		public static int Compare(
			FileOrDirectoryInfo one,
			FileInfo two )
		{
			return string.Compare(
				one.FullName.TrimEnd( '\\' ),
				two.FullName.TrimEnd( '\\' ),
				true );
		}
Example #2
0
		/// <summary>
		/// Splits a path into its parts.
		/// </summary>
		/// <param name="path">The path.</param>
		/// <returns></returns>
		public static SplittedPath SplitPath(
			FileOrDirectoryInfo path )
		{
			return path.SplittedPath;
		}
Example #3
0
		/// <summary>
		/// Checks whether a given folder is empty.
		/// </summary>
		/// <param name="folder">The folder.</param>
		/// <returns>
		/// 	<c>true</c> if the specified folder is empty; otherwise, <c>false</c>.
		/// </returns>
		public static bool IsEmpty(
			FileOrDirectoryInfo folder )
		{
			return IsEmpty( folder.FullName );
		}
Example #4
0
		/// <summary>
		/// Constructor.
		/// </summary>
		/// <param name="path">The path.</param>
		public SplittedPath(
			FileOrDirectoryInfo path )
		{
			this.info = new FileOrDirectoryInfo( path );
		}
		/// <summary>
		/// Compares the specified b.
		/// </summary>
		/// <param name="b">The b.</param>
		/// <returns></returns>
		public int Compare(
			FileOrDirectoryInfo b )
		{
			return Compare( b.FullName );
		}
		/// <summary>
		/// Combines the specified info.
		/// </summary>
		/// <param name="info">The info.</param>
		/// <returns></returns>
		public FileOrDirectoryInfo Combine(
			FileOrDirectoryInfo info )
		{
			return
				new FileOrDirectoryInfo(
				Path.Combine(
				fullPath,
				info.FullName ) );
		}
		/// <summary>
		/// Constructor.
		/// </summary>
		/// <param name="info">The info.</param>
		public FileOrDirectoryInfo(
			FileOrDirectoryInfo info )
		{
			this.fullPath = info.FullName;
			this.originalPath = info.originalPath;
		}
		/// <summary>
		/// Combines the specified one.
		/// </summary>
		/// <param name="one">The one.</param>
		/// <param name="two">The two.</param>
		/// <returns></returns>
		public static FileOrDirectoryInfo Combine(
			FileOrDirectoryInfo one,
			string two )
		{
			return new FileOrDirectoryInfo( one ).Combine( two );
		}
		/// <summary>
		/// Compares the specified one.
		/// </summary>
		/// <param name="one">The one.</param>
		/// <param name="two">The two.</param>
		/// <returns></returns>
		public static int Compare(
			FileOrDirectoryInfo one,
			string two )
		{
			return new FileOrDirectoryInfo( one ).Compare( two );
		}