Example #1
0
        private void ExtractClicked(object sender, System.Windows.RoutedEventArgs e)
        {
            List <Nca> selected = new List <Nca>();

            foreach (TitleElement info in ListView.Items)
            {
                if (info.Selected)
                {
                    foreach (NcaElement nca in info.Ncas)
                    {
                        selected.Add(nca.Nca);
                    }
                }
            }

            Window window = new ExtractPickerWindow(selected);

            window.Owner = Window.GetWindow(this);
            window.ShowDialog();

            /*List<Nca> updates = new List<Nca>();
             * List<Nca> normal = new List<Nca>();
             * Title main = selected.FirstOrDefault(x => x.Metadata.Type == TitleType.Application);
             * foreach (Title title in selected) {
             *  if (title.Metadata.Type == TitleType.Patch)
             *      updates.Add(title.MainNca);
             *  else if(title != main)
             *      normal.Add(title.MainNca);
             * }
             *
             * if(updates.Any() && main == null)
             * {
             *  // no base game found
             *  ;
             * }
             *
             * Dictionary<SectionType, List<NcaSection>> indexed = new Dictionary<SectionType, List<NcaSection>>();
             * foreach (Title title in selected)
             * {
             *  Nca nca = title.MainNca;
             *  if (nca.Header.ContentType != ContentType.Meta)
             *      foreach (NcaSection section in nca.Sections)
             *      {
             *          if (section == null) continue;
             *          if (!indexed.ContainsKey(section.Type)) indexed[section.Type] = new List<NcaSection>();
             *          indexed[section.Type].Add(section);
             *      }
             *  //string path = Path.Combine(folder, nca.Filename);
             *  //nca.GetStream().CopyTo(new FileStream(path, FileMode.Create));
             *
             * }
             * ;*/
        }
Example #2
0
        private void ExtractClicked(object sender, RoutedEventArgs e)
        {
            List <Nca> selected = new List <Nca>();

            foreach (NcaElement info in ListView.Items)
            {
                if (info.Selected)
                {
                    selected.Add(info.Nca);
                }
            }

            Window window = new ExtractPickerWindow(selected);

            window.Owner = Window.GetWindow(this);
            window.ShowDialog();
        }
Example #3
0
        private void ExtractClicked(object sender, RoutedEventArgs e)
        {
            List <SwitchFsNca> selected = new List <SwitchFsNca>();

            foreach (TitleElement info in ListView.Items)
            {
                if (info.Selected)
                {
                    foreach (NcaElement nca in info.Ncas)
                    {
                        selected.Add(nca.Nca);
                    }
                }
            }

            Window window = new ExtractPickerWindow(selected)
            {
                Owner = Window.GetWindow(this)
            };

            window.ShowDialog();

            /*
             * Dictionary<SectionType, List<NcaSection>> indexed = new Dictionary<SectionType, List<NcaSection>>();
             * foreach (Title title in selected)
             * {
             *  Nca nca = title.MainNca;
             *  if (nca.Header.ContentType != ContentType.Meta)
             *      foreach (NcaSection section in nca.Sections)
             *      {
             *          if (section == null) continue;
             *          if (!indexed.ContainsKey(section.Type)) indexed[section.Type] = new List<NcaSection>();
             *          indexed[section.Type].Add(section);
             *      }
             *  //string path = Path.Combine(folder, nca.Filename);
             *  //nca.GetStream().CopyTo(new FileStream(path, FileMode.Create));
             *
             * }
             * ;*/
        }