private static AppLinkItem CreateItem(string path) { AppLinkItem app = null; if (path.Length > 1) { app = new AppLinkItem(path); } return(app); }
private void AddAppsFromShortcuts(string dir) { string[] paths = Directory.GetFiles(dir + "\\Programs", "*.lnk", SearchOption.AllDirectories); // add apps to the list if a link heads to an exe file foreach (string path in paths) { if (path.ToLower().Contains("uninstall")) { continue; } AppLinkItem app = CreateItem(path); if (app != null) { Add(app); } } }