Exemplo n.º 1
0
        // ReSharper restore PrivateFieldCanBeConvertedToLocalVariable

        public GamePicker(API.Client client)
        {
            this._Games             = new Dictionary <uint, GameInfo>();
            this._FilteredGames     = new List <GameInfo>();
            this._SelectedGameIndex = -1;
            this._LogosAttempted    = new List <string>();
            this._LogoQueue         = new ConcurrentQueue <GameInfo>();

            var logoPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
                                        "SAM.Picker.Cache.zip");

            this._CacheArchive = ZipFile.Open(logoPath, ZipArchiveMode.Update);

            this.InitializeComponent();

            var blank = new Bitmap(this._LogoImageList.ImageSize.Width, this._LogoImageList.ImageSize.Height);

            using (var g = Graphics.FromImage(blank))
            {
                g.Clear(Color.DimGray);
            }

            this._LogoImageList.Images.Add("Blank", blank);

            this._SteamClient = client;

            this._AppDataChangedCallback        = client.CreateAndRegisterCallback <API.Callbacks.AppDataChanged>();
            this._AppDataChangedCallback.OnRun += this.OnAppDataChanged;

            this.AddGames();
        }
        // ReSharper restore PrivateFieldCanBeConvertedToLocalVariable

        public GamePicker(API.Client client)
        {
            this._Games          = new Dictionary <uint, GameInfo>();
            this._FilteredGames  = new List <GameInfo>();
            this._LogosAttempted = new List <string>();
            this._LogoQueue      = new ConcurrentQueue <GameInfo>();

            this.InitializeComponent();

            var blank = new Bitmap(this._LogoImageList.ImageSize.Width, this._LogoImageList.ImageSize.Height);

            using (var g = Graphics.FromImage(blank))
            {
                g.Clear(Color.DimGray);
            }

            this._LogoImageList.Images.Add("Blank", blank);

            this._SteamClient = client;

            this._AppDataChangedCallback        = client.CreateAndRegisterCallback <API.Callbacks.AppDataChanged>();
            this._AppDataChangedCallback.OnRun += this.OnAppDataChanged;

            this.AddGames();
        }
        // ReSharper restore PrivateFieldCanBeConvertedToLocalVariable

        public GamePicker(API.Client client)
        {
            this.InitializeComponent();

            this._GameLogoImageList.Images.Add(
                "Blank",
                new Bitmap(this._GameLogoImageList.ImageSize.Width, this._GameLogoImageList.ImageSize.Height));

            this._GameListDownloader.DownloadDataCompleted += this.OnGameListDownload;
            this._LogoDownloader.DownloadDataCompleted     += this.OnLogoDownload;

            this._SteamClient = client;

            this._AppDataChangedCallback        = client.CreateAndRegisterCallback <API.Callbacks.AppDataChanged>();
            this._AppDataChangedCallback.OnRun += this.OnAppDataChanged;

            this.AddGames();
        }