public void GetLibraryData(Item[] data)
        {
            DataGame.Items.Clear();
            Int32 LenguageEnglish = 0;
            Int32 LenguageJapan   = 0;
            Int32 LenguageOther   = 0;
            Int64 TotalSize       = 0;
            Int64 TotalGame       = 0;

            foreach (Item rows in data)
            {
                if (rows != null)
                {
                    TotalGame++;
                    DataGame.Items.Add(rows);
                    if (rows.Region == "USA" || rows.Region == "Europe")
                    {
                        LenguageEnglish++;
                    }
                    else if (rows.Region == "Japan")
                    {
                        LenguageJapan++;
                    }
                    else
                    {
                        LenguageOther++;
                    }
                    TotalSize += rows.Detail.Size;
                }
            }
            lblTotalGame.Content = TotalGame + " Games";
            lblTotalSize.Content = PSPGame.GetSize(TotalSize);
            lblLanguage.Content  = "";
            if (LenguageEnglish != 0)
            {
                lblLanguage.Content += "English(" + LenguageEnglish + ")  ";
            }
            if (LenguageJapan != 0)
            {
                lblLanguage.Content += "Japan(" + LenguageJapan + ")  ";
            }
            if (LenguageOther != 0)
            {
                lblLanguage.Content += "Other(" + LenguageOther + ")  ";
            }
            DataGame.Columns[1].SortDirection = ListSortDirection.Ascending;
        }
        void SelectedDataGame()
        {
            Item Selected = (Item)DataGame.SelectedValue;

            _DataDriectory = _ConfigStore + Selected.DiscID + "\\";
            switch (Int32.Parse(_ConfigDefault.Param("Mode")))
            {
            case 0:
                ImageIcon.Source       = GetImage("none.jpg");
                ImageBackground.Source = GetImage("ScreenShot.png");
                lblTitleGame.Content   = Selected.Detail.Title;
                lblFilename.Content    = Selected.Detail.Name;
                lblVersion.Content     = Selected.Detail.Version;
                lblFirmware.Content    = Selected.Firmware;
                lblParental.Content    = Selected.Detail.Parental;
                lblRegion.Content      = Selected.Region;
                lblRelease.Content     = DateTime.FromBinary(Int64.Parse(Selected.Detail.Release)).ToShortDateString();
                lblPlayers.Content     = Selected.Detail.Player;
                lblGenre.Content       = Selected.Detail.Genre;
                lblCatalogory.Content  = Selected.Detail.Catagory + "-" + Selected.DiscID;
                lblType.Content        = Selected.Detail.Type;
                lblCreated.Content     = Selected.Detail.Created;
                lblSize.Content        = PSPGame.GetSize(Selected.Detail.Size);
                lblPublisher.Content   = Selected.Detail.Publisher;
                lblDeveloper.Content   = Selected.Detail.Developer;
                // Preview
                ImageSnap1.Source = GetImage("none.jpg");
                ImageSnap2.Source = GetImage("none.jpg");
                ImageSnap3.Source = GetImage("none.jpg");
                ImageSnap4.Source = GetImage("none.jpg");
                ImageSnap5.Source = GetImage("none.jpg");
                ImageSnap6.Source = GetImage("none.jpg");

                if (Selected.Detail.Release == "0")
                {
                    lblRelease.Content = "N/A";
                }
                if (Selected.Detail.Player == "0")
                {
                    lblPlayers.Content = "N/A";
                }
                if (Selected.Detail.Genre == "0")
                {
                    lblGenre.Content = "N/A";
                }
                if (Selected.Detail.Publisher == "0")
                {
                    lblPublisher.Content = "N/A";
                }
                if (Selected.Detail.Developer == "0")
                {
                    lblDeveloper.Content = "N/A";
                }

                if (Selected.Detail.Icon != null)
                {
                    ImageIcon.Source = BitmapFrame.Create(new Uri(_DataDriectory + Selected.Detail.Icon));
                }
                if (Selected.Detail.Background != null)
                {
                    ImageBackground.Source = BitmapFrame.Create(new Uri(_DataDriectory + Selected.Detail.Background));
                }
                if (Selected.Detail.Snapshot1 != null)
                {
                    ImageSnap1.Source = BitmapFrame.Create(new Uri(_DataDriectory + Selected.Detail.Snapshot1));
                }
                if (Selected.Detail.Snapshot2 != null)
                {
                    ImageSnap2.Source = BitmapFrame.Create(new Uri(_DataDriectory + Selected.Detail.Snapshot2));
                }
                if (Selected.Detail.Snapshot3 != null)
                {
                    ImageSnap3.Source = BitmapFrame.Create(new Uri(_DataDriectory + Selected.Detail.Snapshot3));
                }
                if (Selected.Detail.Snapshot4 != null)
                {
                    ImageSnap4.Source = BitmapFrame.Create(new Uri(_DataDriectory + Selected.Detail.Snapshot4));
                }
                if (Selected.Detail.Snapshot5 != null)
                {
                    ImageSnap5.Source = BitmapFrame.Create(new Uri(_DataDriectory + Selected.Detail.Snapshot5));
                }
                if (Selected.Detail.Snapshot6 != null)
                {
                    ImageSnap6.Source = BitmapFrame.Create(new Uri(_DataDriectory + Selected.Detail.Snapshot6));
                }
                break;

            case 1:
                EditName.Text            = Selected.Detail.Name;
                EditPublisher.Text       = Selected.Detail.Publisher;
                EditDeveloper.Text       = Selected.Detail.Developer;
                EditDescription.Text     = Selected.Detail.Description;
                EditRelease.SelectedDate = DateTime.FromBinary(Int64.Parse(Selected.Detail.Release));

                if (Selected.Detail.Release == "0")
                {
                    EditRelease.SelectedDate = DateTime.Now;
                }
                if (Selected.Detail.Publisher == "0")
                {
                    EditPublisher.Text = "";
                }
                if (Selected.Detail.Developer == "0")
                {
                    EditDeveloper.Text = "";
                }
                if (Selected.Detail.Description == "0")
                {
                    EditDescription.Text = "";
                }

                foreach (ComboBoxItem item in EditGenre.Items)
                {
                    if (item.Content.ToString() == Selected.Detail.Genre.ToString())
                    {
                        EditGenre.SelectedItem = item;
                        break;
                    }
                }
                switch (Int32.Parse(Selected.Detail.Player))
                {
                case 1: EditPlayer1.IsChecked = true; break;

                case 2: EditPlayer2.IsChecked = true; break;

                case 3: EditPlayer3.IsChecked = true; break;

                case 4: EditPlayer4.IsChecked = true; break;

                case 5: EditPlayer5.IsChecked = true; break;
                }
                break;
            }
        }
Пример #3
0
        private void SyncISO_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            ImagePreview.Cursor = Cursors.Arrow;

            if (!(e.Error == null))
            {
            }
            else if (e.Cancelled)
            {
                lblPreload.Cursor       = Cursors.Arrow;
                lblFilename.Cursor      = Cursors.Arrow;
                CaptionClose.Visibility = Visibility.Hidden;
                btnExit.Visibility      = Visibility.Visible;
            }
            else
            {
                String      DataDirectory = _ConfigStore + _ItemGame.DiscID + "\\";
                ImageSource _IconGame     = BitmapFrame.Create(new Uri(DataDirectory + _ItemGame.Detail.Icon));
                Console.WriteLine(_IconGame.Height + "==" + _IconGame.Width);
                //IconBorder.Width = _IconGame.Width;
                IconImage.Source = _IconGame;
                if (_ItemGame.Detail.Snapshot1 != null)
                {
                    SSImage1.Source = BitmapFrame.Create(new Uri(DataDirectory + _ItemGame.Detail.Snapshot1));
                }
                else
                {
                    SSBorder1.Visibility = Visibility.Hidden;
                }
                if (_ItemGame.Detail.Snapshot2 != null)
                {
                    SSImage2.Source = BitmapFrame.Create(new Uri(DataDirectory + _ItemGame.Detail.Snapshot2));
                }
                else
                {
                    SSBorder2.Visibility = Visibility.Hidden;
                }
                if (_ItemGame.Detail.Snapshot3 != null)
                {
                    SSImage3.Source = BitmapFrame.Create(new Uri(DataDirectory + _ItemGame.Detail.Snapshot3));
                }
                else
                {
                    SSBorder3.Visibility = Visibility.Hidden;
                }
                if (_ItemGame.Detail.Snapshot4 != null)
                {
                    SSImage4.Source = BitmapFrame.Create(new Uri(DataDirectory + _ItemGame.Detail.Snapshot4));
                }
                else
                {
                    SSBorder4.Visibility = Visibility.Hidden;
                }
                if (_ItemGame.Detail.Snapshot5 != null)
                {
                    SSImage5.Source = BitmapFrame.Create(new Uri(DataDirectory + _ItemGame.Detail.Snapshot5));
                }
                else
                {
                    SSBorder5.Visibility = Visibility.Hidden;
                }
                if (_ItemGame.Detail.Snapshot6 != null)
                {
                    SSImage6.Source = BitmapFrame.Create(new Uri(DataDirectory + _ItemGame.Detail.Snapshot6));
                }
                else
                {
                    SSBorder6.Visibility = Visibility.Hidden;
                }

                txtTitleGame.Text     = _ItemGame.Detail.Title;
                lblFilename1.Content  = Path.GetFileNameWithoutExtension(_ISOGame);
                lblCreated.Content    = _ItemGame.Detail.Created;
                lblSize.Content       = PSPGame.GetSize(_ItemGame.Detail.Size);
                lblRegion.Content     = _ItemGame.Detail.Type;
                lblGenre.Content      = _ItemGame.Detail.Genre;
                lblRelease.Content    = DateTime.FromBinary(Int64.Parse(_ItemGame.Detail.Release)).ToShortDateString();
                lblPlayers.Content    = _ItemGame.Detail.Player;
                lblPublisher.Content  = _ItemGame.Detail.Publisher;
                lblDeveloper.Content  = _ItemGame.Detail.Developer;
                lblDescription.Text   = _ItemGame.Detail.Description;
                lblCatalogory.Content = _ItemGame.Detail.Catagory + "-" + _ItemGame.DiscID;
                lblVersion.Content    = _ItemGame.Detail.Version;
                lblFirmware.Content   = _ItemGame.Firmware;
                lblParental.Content   = _ItemGame.Detail.Parental;

                if (lblGenre.Content.ToString() == "0")
                {
                    lblGenre.Content = "N/A";
                }
                if (lblRegion.Content.ToString() == "0")
                {
                    lblRegion.Content = "N/A";
                }
                if (lblRelease.Content.ToString() == "0")
                {
                    lblRelease.Content = "N/A";
                }
                if (lblPlayers.Content.ToString() == "0")
                {
                    lblPlayers.Content = "N/A";
                }
                if (lblPublisher.Content.ToString() == "0")
                {
                    lblPublisher.Content = "N/A";
                }
                if (lblDeveloper.Content.ToString() == "0")
                {
                    lblDeveloper.Content = "N/A";
                }
                if (lblDescription.Text.ToString() == "0")
                {
                    lblDescription.Text = "N/A";
                }


                // View Details
                GridPreload.Visibility    = Visibility.Hidden;
                GridDetails.Visibility    = Visibility.Visible;
                GridScreenshot.Visibility = Visibility.Visible;
                _CloseDialog = true;
            }
        }