Ejemplo n.º 1
0
		public static DiskItem Get(string fullName)
		{
			var result = new DiskItem(null);
			if (string.IsNullOrEmpty(fullName))
				return result;

			fullName = DiskItem.Simplify(fullName);

			var parts = new List<string>();
			while (fullName != "")
			{
				parts.Insert(0, fullName);
				fullName = GetPath(fullName);
			}

			foreach (var part in parts)
			{
				if ((result == null) || (!result.HasChildren))
					return null;
				result = result.GetChildren().FirstOrDefault(child => child.FullName.Equals(part, StringComparison.InvariantCultureIgnoreCase));
			}

			return result;
		}
Ejemplo n.º 2
0
		public bool Equals(DiskItem item) => FullName == item.FullName;
Ejemplo n.º 3
0
		public bool IsChildOf(DiskItem item) => IsChildOf(item.FullName);