Beispiel #1
0
        /// <summary>
        ///     Returns the users game region, either automatically set region by searching existing console directories or prompt
        ///     the user to select one
        /// </summary>
        /// <param name="ipAddress">Selected game</param>
        /// <param name="game">Automatically retrieve users region</param>
        /// <param name="detectRegion">Automatically retrieve users region</param>
        /// <returns></returns>
        internal static string GetUsersGameRegion(string ipAddress, GamesData.Game game, bool detectRegion)
        {
            if (detectRegion)
            {
                using (var ps3 = new FtpConnection(ipAddress))
                    foreach (var region in game.Regions)
                    {
                        if (ps3.DirectoryExists($"dev_hdd0/game/{region}/"))
                        {
                            return(region);
                        }
                    }
            }
            else
            {
                Windows.RegionsWindow frmRegions = new Windows.RegionsWindow();
                foreach (var region in game.Regions)
                {
                    frmRegions.ListViewRegions.Items.Add(new DarkUI.Controls.DarkListItem()
                    {
                        Text = region
                    });
                }
                frmRegions.ShowDialog();
                return(frmRegions.SelectedRegion);
            }

            return(null);
        }
Beispiel #2
0
        /// <summary>
        ///     Creates and adds the game title object into the list of games
        /// </summary>
        /// <param name="game">Game data item</param>
        public void AddGameTitle(GamesData.Game game)
        {
            Label gameTitle = new Label
            {
                AutoSize  = false,
                Width     = FlowPanelGames.Width,
                Height    = 27,
                Text      = game.Title,
                TextAlign = ContentAlignment.MiddleCenter,
                Font      = new Font("Segoe UI", 9F, FontStyle.Regular),
                BackColor = Color.Transparent,
                ForeColor = Color.Gainsboro,
                Margin    = new Padding(0, 0, 0, 0),
                Cursor    = Cursors.Hand,
                Name      = game.Id
            };

            gameTitle.MouseEnter += GameTitle_MouseEnter;
            gameTitle.MouseLeave += GameTitle_MouseLeave;
            gameTitle.Click      += GameTitle_Click;
            FlowPanelGames.Controls.Add(gameTitle);
        }