private void AddLblTxtForDynamicPAKs() { if (PAKEntries.PAKEntriesList != null && PAKEntries.PAKEntriesList.Any()) { if (AESEntries.AESEntriesList == null) { KeysManager.Deserialize(); } int yPos = 4; foreach (PAKInfosEntry Pak in PAKEntries.PAKEntriesList.Where(x => x.bTheDynamicPAK)) { Label PakLabel = new Label { Content = Path.GetFileNameWithoutExtension(Pak.ThePAKPath), HorizontalAlignment = HorizontalAlignment.Left, Margin = new Thickness(2, yPos - 2, 0, 0), VerticalAlignment = VerticalAlignment.Top, Foreground = new SolidColorBrush(Color.FromRgb(239, 239, 239)) }; TextBox PakTextBox = new TextBox { Height = 19, TextWrapping = TextWrapping.NoWrap, AcceptsReturn = false, Margin = new Thickness(160, yPos, 5, 0), VerticalAlignment = VerticalAlignment.Top, Foreground = new SolidColorBrush(Color.FromRgb(239, 239, 239)), Name = $"TxtBox_{Regex.Match(Path.GetFileNameWithoutExtension(Pak.ThePAKPath), @"\d+").Value}" }; string PAKKeyFromXML = string.Empty; if (AESEntries.AESEntriesList != null && AESEntries.AESEntriesList.Any()) { PAKKeyFromXML = AESEntries.AESEntriesList.Where(x => string.Equals(x.ThePAKName, Path.GetFileNameWithoutExtension(Pak.ThePAKPath))).Select(x => x.ThePAKKey).FirstOrDefault(); PakTextBox.Text = $"0x{PAKKeyFromXML}"; } yPos += 28; Grid_DynamicKeys.Children.Add(PakLabel); Grid_DynamicKeys.Children.Add(PakTextBox); DebugHelper.WriteLine($"AESManager GET: {Pak.ThePAKPath} with key: {PAKKeyFromXML}"); } } }
private void AddLblTxtForDynamicPAKs() { if (PAKEntries.PAKEntriesList != null && PAKEntries.PAKEntriesList.Any()) { if (AESEntries.AESEntriesList == null) { KeysManager.Deserialize(); } int yPos = 4; foreach (PAKInfosEntry Pak in PAKEntries.PAKEntriesList.Where(x => x.bTheDynamicPAK == true)) { Label PakLabel = new Label(); PakLabel.Content = Path.GetFileNameWithoutExtension(Pak.ThePAKPath); PakLabel.HorizontalAlignment = HorizontalAlignment.Left; PakLabel.Margin = new Thickness(2, yPos - 2, 0, 0); PakLabel.VerticalAlignment = VerticalAlignment.Top; PakLabel.Foreground = new SolidColorBrush(Color.FromRgb(239, 239, 239)); TextBox PakTextBox = new TextBox(); PakTextBox.Height = 19; PakTextBox.TextWrapping = TextWrapping.NoWrap; PakTextBox.AcceptsReturn = false; PakTextBox.Margin = new Thickness(160, yPos, 5, 0); PakTextBox.VerticalAlignment = VerticalAlignment.Top; PakTextBox.Foreground = new SolidColorBrush(Color.FromRgb(239, 239, 239)); PakTextBox.Name = $"TxtBox_{Regex.Match(Path.GetFileNameWithoutExtension(Pak.ThePAKPath), @"\d+").Value}"; if (AESEntries.AESEntriesList != null && AESEntries.AESEntriesList.Any()) { string PAKKeyFromXML = AESEntries.AESEntriesList.Where(x => string.Equals(x.ThePAKName, Path.GetFileNameWithoutExtension(Pak.ThePAKPath))).Select(x => x.ThePAKKey).FirstOrDefault(); PakTextBox.Text = $"0x{PAKKeyFromXML}"; } yPos += 28; Grid_DynamicKeys.Children.Add(PakLabel); Grid_DynamicKeys.Children.Add(PakTextBox); } } }