private void ValidatePathToTarget(IThemeListLoader loader, ThemeListNode themeList) { IsInitialized = false; Target = loader.LoadedNode(themeList, PathToNode); IsInitialized = true; if (Target == null) { State = ShortcutState.Broken; loader.ShortcutIsBroken(this); } else { State = ShortcutState.Verified; } }
public ShortcutNode(string name, string path, IThemeListLoader loader) : this() { if (path == null) throw new ArgumentNullException("path"); if (path == null) throw new ArgumentNullException("loader"); IsInitialized = false; Name = name; PathToTarget = path; ThemeListNode themeList = loader.LoadedThemeList(PathToThemeList); if (themeList == null) WaitForThemeList(loader); else ValidatePathToTarget(loader, themeList); IsInitialized = true; }
private void WaitForThemeList(IThemeListLoader loader) { State = ShortcutState.WaitingForThemeList; loader.ThemeListLoadedEvent += ValidatePathToTarget; }