Esempio 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;
		}
Esempio n. 2
0
		public bool Equals(DiskItem item) => FullName == item.FullName;
Esempio n. 3
0
		public bool IsChildOf(DiskItem item) => IsChildOf(item.FullName);