System.IO.DirectoryExtensions.HasParentChildRelation C# (CSharp) Méthode

HasParentChildRelation() public static méthode

public static HasParentChildRelation ( this expectedParent, DirectoryInfo maybeOrphan ) : bool
expectedParent this
maybeOrphan DirectoryInfo
Résultat bool
		public static bool HasParentChildRelation(this DirectoryInfo expectedParent, DirectoryInfo maybeOrphan)
		{
			for (var current = maybeOrphan; current != null; current = current.Parent)
			{
				if (expectedParent.FullName.Equals(current.FullName, StringComparison.InvariantCultureIgnoreCase))
				{
					return true;
				}
			}
			return false;
		}
	}