public IEnumerator AddWindowCaptureAppIcon(UwcWindow window) { window.PopulateFriendlyTitle(); string key = window.GetAppKey(); //Check if the app already exists foreach (AppIcon temp in apps) { if (temp.appKey == key) { yield break; } } window.RequestCaptureIcon(); yield return(new WaitForSeconds(0.3f)); StartMenuAppSer appSer = new StartMenuAppSer { appKey = key, appTitle = window.friendlyTitle, filePath = WinNative.GetFilePath(window.handle), isCustomApp = false, isFavorite = false, }; DPSettings.config.startMenu.apps.Add(appSer); _customAppManager.CacheAppIcon(appSer.appKey, window.iconTexture); yield return(new WaitForSeconds(0.2f)); LoadApps(false); SaveLoaded(); }
public void SaveLoaded() { if (!loaded) { return; } DPSettings.config.startMenu.apps.Clear(); foreach (AppIcon appIcon in apps) { StartMenuAppSer appSer = new StartMenuAppSer() { appKey = appIcon.appKey, appTitle = appIcon.text.text, filePath = appIcon.filePath, isCustomApp = appIcon.isCustomApp, isFavorite = appIcon.isFavorite }; DPSettings.config.startMenu.apps.Add(appSer); } DPSettings.SaveSettingsJson(); }