bool LoadFile(string pathToFile) { if (!File.Exists(pathToFile)) { Debug.LogError("EgoXproject: Change file does not exist: " + pathToFile); return(false); } SavePath = pathToFile; PList p = new PList(); if (!p.Load(SavePath)) { return(false); } if (!Validate(p)) { return(false); } //set the platform. if non specified will default to ios BuildPlatform platform; if (p.Root.EnumValue(BUILD_PLATFORM_KEY, out platform)) { Platform = platform; } else { Platform = BuildPlatform.iOS; } //reset everything Frameworks.Clear(); FilesAndFolders.Clear(); BuildSettings.Clear(); Scripts.Clear(); Signing.Clear(); Capabilities.Clear(); //load everything InfoPlistChanges = p.Root.DictionaryValue(INFO_PLIST_KEY).Copy() as PListDictionary; AppConfig = p.Root.DictionaryValue(APP_CONFIG_KEY) != null?p.Root.DictionaryValue(APP_CONFIG_KEY).Copy() as PListDictionary : new PListDictionary(); AppConfigEnabled = p.Root.ArrayValue(APP_CONFIG_ENABLED_KEY) != null?p.Root.ArrayValue(APP_CONFIG_ENABLED_KEY).Copy() as PListArray : new PListArray(); ManualEntitlements = p.Root.DictionaryValue(MANUAL_ENTITLEMENTS) != null?p.Root.DictionaryValue(MANUAL_ENTITLEMENTS).Copy() as PListDictionary : new PListDictionary(); LoadFrameworks(p.Root.DictionaryValue(FRAMEWORKS_KEY)); LoadFilesAndFolders(p.Root.DictionaryValue(FILES_AND_FOLDERS_KEY)); LoadScripts(p.Root.ArrayValue(SCRIPTS_KEY)); LoadBuildSettings(p.Root.ArrayValue(BUILD_SETTINGS_KEY)); LoadSigning(p.Root.DictionaryValue(SIGNING_KEY)); LoadCapabilities(p.Root.DictionaryValue(CAPABILITIES_KEY)); IsDirty = false; return(true); }
public void Clear() { Apprenticeships.Clear(); Courses.Clear(); Frameworks.Clear(); ProgTypes.Clear(); Providers.Clear(); SectorSubjectAreaTier1s.Clear(); SectorSubjectAreaTier2s.Clear(); Standards.Clear(); StandardSectorCodes.Clear(); Venues.Clear(); }
protected void UpdateFrameworks() { Frameworks.Clear(); if (LocalPackage != null && InstallPath != null) { foreach (var toplevelFolder in new[] { "tools", "lib" }) { var libDirectory = Path.Combine(InstallPath, toplevelFolder); var frameworks = Directory.EnumerateDirectories(libDirectory); foreach (var frameworkPath in frameworks) { var frameworkFolder = new DirectoryInfo(frameworkPath).Name; if (File.Exists(Path.Combine(frameworkPath, "Stride.GameStudio.exe")) || File.Exists(Path.Combine(frameworkPath, "Xenko.GameStudio.exe"))) { Frameworks.Add(frameworkFolder); } } } if (Frameworks.Count > 0) { try { // If preferred framework exists in our list, select it var preferredFramework = LauncherSettings.PreferredFramework; if (Frameworks.Contains(preferredFramework)) { SelectedFramework = preferredFramework; } else { // Otherwise, try to find a framework of the same kind (.NET Core or .NET Framework) var nugetFramework = NuGetFramework.ParseFolder(preferredFramework); SelectedFramework = Frameworks.FirstOrDefault(x => NuGetFramework.ParseFolder(preferredFramework).Framework == nugetFramework.Framework) ?? Frameworks.First(); // otherwise fallback to first choice } } catch { SelectedFramework = Frameworks.First(); } } } }