public Item(DirectoryInfo directoryInfo, Settings settings) : base(directoryInfo) { State = new ItemState(); Settings = settings; IsSizeCalculating = true; IsDisabledValue = Settings.DisabledItems.Contains(Info.FullName); DirectorySet = Settings.GetDirectorySet(Path); if (DirectorySet == null) { HasError = true; Error = "Missing DirectorySet"; } if (!IsSymLink) { Target = DirectorySet?.Target.FullName; } if (Target == null) { Target = ""; } PropertyChanged += Item_PropertyChanged; CalculateSize(); }
public DirectorySet GetDirectorySet(string source) { DirectorySet result = null; foreach (DirectorySet dirSet in DirectorySets) { if (dirSet.Source.FullName.Equals(source)) { result = dirSet; break; } } return(result); }