Esempio n. 1
0
        private void BracketSynchro()
        {
            BracketApi    api  = Activator.CreateInstance(Configuration.Instance.Bracket.Api, Configuration.Instance.Bracket) as BracketApi;
            List <Player> list = api.GetAllEntrants();

            foreach (Player player in list)
            {
                PlayerDatabase.UpdateOrAddPlayer(player);
            }
        }
Esempio n. 2
0
 private void RefreshApiLink()
 {
     try
     {
         _api = Activator.CreateInstance(Configuration.Instance.Bracket.Api, Configuration.Instance.Bracket) as BracketApi;
     }
     catch (Exception e)
     {
         // api not set
     }
 }
Esempio n. 3
0
        private void InitializeBracketApiList()
        {
            Type[] apis = Assembly.GetExecutingAssembly().GetTypes().Where((t) => t.IsSubclassOf(typeof(BracketApi))).ToArray();
            ApiList = new ObservableCollection <string>();
            foreach (var type in apis)
            {
                BracketSettings s = new BracketSettings();
                BracketApi      a = Activator.CreateInstance(type, s) as BracketApi;
                ApiList.Add(a.ApiName);

                if (type == Configuration.Instance.Stream?.GetType())
                {
                    SelectedApi = ApiList.Count - 1;
                }
            }
        }
Esempio n. 4
0
 private void InitializeApiLink()
 {
     try
     {
         _refreshInfo.Stop();
         IsInitialized = false;
         _apiLink      = Activator.CreateInstance(Configuration.Instance.Bracket.Api, Configuration.Instance.Bracket) as BracketApi;
         Log.Trace("API Link succesfully created");
         IsConfigured = true;
         _refreshInfo.Start();
     }
     catch
     {
         Log.Warn("API Link not created. Probably wrong configuration");
         IsConfigured = false;
     }
 }