Exemplo n.º 1
0
        public static void Wait(string url)
        {
            if (url.ToLower().Contains("thegamesdb.net"))
            {
                GamesDB.Wait();
                return;
            }

            if (url.ToLower().Contains("giantbomb.com"))
            {
                GiantBomb.Wait();
                return;
            }

            if (url.ToLower().Contains("gamefaqs.net"))
            {
                GameFAQ.Wait();
                return;
            }

            if (url.ToLower().Contains("launchbox-app.com"))
            {
                LaunchBox.Wait();
                return;
            }
        }
        async void InitializeDBs()
        {
            if (System.ComponentModel.DesignerProperties.GetIsInDesignMode(new DependencyObject()))
            {
                //TODO: put some dummy components here for design time
            }

            // Trying to load this stuff at design time will throw an exception and crash the designer
            else
            {
                Datomatic datomatic = null;
                await Task.Run(() => { datomatic = new Datomatic(); });

                IDBs.Add(datomatic);

                GamesDB gamesDB = null;
                await Task.Run(() => { gamesDB = new GamesDB(); });

                IDBs.Add(gamesDB);

                GiantBomb giantBomb = null;
                await Task.Run(() => { giantBomb = new GiantBomb(); });

                IDBs.Add(giantBomb);

                OpenVGDB openVGDB = null;
                await Task.Run(() => { openVGDB = new OpenVGDB(); });

                IDBs.Add(openVGDB);

                Launchbox launchBox = null;
                await Task.Run(() => { launchBox = new Launchbox(); });

                IDBs.Add(launchBox);
            }
        }