Exemplo n.º 1
0
        public SaveInfoWindow(SaveElement element)
        {
            Element = element;
            InitializeComponent();

            if (Element.Owner == "Unknown")
            {
                foreach (var frame in new List <LabelBoxFrame>(FramePanel.Children.OfType <LabelBoxFrame>())
                         .Where(c => c.Label == "Owner"))
                {
                    FramePanel.Children.Remove(frame);
                }
            }

            if (string.Format("{0:x16}", SaveID) == SaveName)
            {
                foreach (var frame in new List <LabelBoxFrame>(FramePanel.Children.OfType <LabelBoxFrame>())
                         .Where(c => c.Label == "Name"))
                {
                    FramePanel.Children.Remove(frame);
                }
            }

            MountTypesComboBox.Items.Add(OpenType.ReadOnly);
            MountTypesComboBox.SelectedIndex = 0;
            //if (IsWritable(element.Save))
            //    MountTypesComboBox.Items.Add(OpenType.Writable);

            Task <ImageSource> task = GetIconAync();

            ProfileIcon.Source = ApplicationElement.UnknownIcon;
            task.ContinueWith((source) => ProfileIcon.Dispatcher.Invoke(() => ProfileIcon.Source = source.Result));
            TaskManagerPage.Current.Queue.Submit(new RunTask($"Decoding profile icon...", task));
        }
Exemplo n.º 2
0
        private void Refresh()
        {
            Dispatcher.BeginInvoke(new Action(() =>
            {
                ListView.Items.Clear();

                foreach (KeyValuePair <string, SaveDataFileSystem> kv in DeviceService.Saves)
                {
                    SaveElement element = new SaveElement(kv);
                    if (TitleID == 0)
                    {
                        if ((element.SaveId & 0x8000000000000000) != 0 || !DeviceService.Titles.ContainsKey(element.SaveId)) // if a save is not represented in the title manager, it should be shown in the saves manager
                        {
                            ListView.Items.Add(element);
                        }
                    }
                    else
                    {
                        if (element.SaveId == TitleID)
                        {
                            ListView.Items.Add(element);
                        }
                        if ((ulong)SystemSaveNames.GetOwner(element.Save) == TitleID)
                        {
                            ListView.Items.Add(element);
                        }
                    }
                }
            })).Wait();
        }
Exemplo n.º 3
0
        private void SaveDoubleClicked(object sender, MouseButtonEventArgs e)
        {
            SaveElement element = ListView.SelectedItem as SaveElement;
            ulong       view    = element.SaveId;

            if (view == 0)
            {
                view = element.TitleId;
            }
            MountService.Mount(new MountableFileSystem(element.Save, view.ToString("x16"), "Savefile", LibHac.IO.OpenMode.Read));
        }