protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { base.OnNavigatedTo(e); gamePath = NavigationContext.QueryString["game"]; manifestEX = new ManifestEX(gamePath + "\\uve-manifestEX.uvm"); nsg = new NSGameSettings(gamePath); switch (nsg.screentype) { case 1: ratio.IsChecked = true; break; case 2: wide.IsChecked = true; break; } ratio.Checked += RadioButton_Checked_1; wide.Checked += RadioButton_Checked_2; ShowInfo(); }
public FileList() { IsolatedStorageFile storage = IsolatedStorageFile.GetUserStoreForApplication(); string[] folderlist = storage.GetDirectoryNames(), filelist = storage.GetFileNames(); string[] info = new string[30]; string IconUri = ""; int temp = 0, temp2 = 0; for (int i = 0; i < folderlist.Length; i++) { bool IsGame = false; if (storage.FileExists(Path.Combine(folderlist[i], "uve-manifest.uvm"))) { IsGame = true; IsolatedStorageFileStream location = new IsolatedStorageFileStream(Path.Combine(folderlist[i], "uve-manifest.uvm"), FileMode.Open, storage); StreamReader file = new StreamReader(location); for (int j = 0; !file.EndOfStream; j++) { info[j] = file.ReadLine(); temp = j; } for (int j = 0; j < temp; j++) { if (info[j].StartsWith("[Info]")) { temp2 = 1; } else if (info[j].StartsWith("[Tile]")) { temp2 = 3; } else { if (temp2 == 3) { if (info[j].StartsWith("Icon=")) { IconUri = Path.Combine(folderlist[i], "Icon", info[j].Remove(0, 5)); } } } } location.Close(); file.Close(); } else if (storage.FileExists(Path.Combine(folderlist[i], "uve-manifestEX.uvm"))) { IsGame = true; ManifestEX mex = new ManifestEX(Path.Combine(folderlist[i], "uve-manifestEX.uvm")); IconUri = Path.Combine(folderlist[i], mex.IconPath); } Add(new File(folderlist[i], true, IsGame, IconUri)); } for (int i = 0; i < filelist.Length; i++) { Add(new File(filelist[i], false, false, "")); } }
public GameLists() { IsolatedStorageFile storage = IsolatedStorageFile.GetUserStoreForApplication(); string[] list = storage.GetDirectoryNames(); for (int i = 0; i < list.Length; i++) { if (storage.FileExists(Path.Combine(list[i], "uve-manifest.uvm"))) { string GameName = "", Company = "", GameSize = "", GameMaker = "", IconUri = ""; string[] info = new string[30]; int temp = 0, temp2 = 0; try { IsolatedStorageFileStream location = new IsolatedStorageFileStream(Path.Combine(list[i], "uve-manifest.uvm"), FileMode.Open, storage); StreamReader file = new StreamReader(location); for (int j = 0; !file.EndOfStream; j++) { info[j] = file.ReadLine(); temp = j; } location.Close(); file.Close(); } catch (Exception e) { MessageBox.Show(UVEngine.Resources.UVEngine.listerror + e.Message, UVEngine.Resources.UVEngine.error, MessageBoxButton.OK); } for (int j = 0; j < temp; j++) { if (info[j].StartsWith("[Info]")) { temp2 = 1; } else if (info[j].StartsWith("[Tile]")) { temp2 = 3; } else if (temp2 == 1) { if (info[j].StartsWith("GameName=")) { GameName = info[j].Remove(0, 9); } else if (info[j].StartsWith("Company=")) { Company = info[j].Remove(0, 8); } else if (info[j].StartsWith("GameMaker=")) { GameMaker = info[j].Remove(0, 10); } else if (info[j].StartsWith("GameSize=")) { GameSize = info[j].Remove(0, 9); } } else if (temp2 == 3) { if (info[j].StartsWith("Icon=")) { IconUri = Path.Combine(list[i], "Icon", info[j].Remove(0, 5)); } } } Add(new GameList(list[i], GameName, IconUri, Company, GameSize, GameMaker)); } else if (storage.FileExists(Path.Combine(list[i], "uve-manifestEX.uvm"))) { ManifestEX mex = new ManifestEX(Path.Combine(list[i], "uve-manifestEX.uvm")); Add(new GameList(list[i], mex.GameName, Path.Combine(list[i], mex.IconPath), mex.GameCompany, mex.GameSize, mex.GameMaker)); } } }