GW2PAO.API.Services.EventsService.LoadTables C# (CSharp) Méthode

LoadTables() public méthode

Loads the events time tables and initializes all cached event information
public LoadTables ( bool isAdjustedBossTimersTable ) : void
isAdjustedBossTimersTable bool
Résultat void
        public void LoadTables(bool isAdjustedBossTimersTable)
        {
            logger.Info("Loading World Boss Events Time Table");
            try
            {
                this.WorldBossEventTimeTable = WorldBossEventTimeTable.LoadTable(isAdjustedBossTimersTable);
            }
            catch (Exception ex)
            {
                logger.Error(ex);
                logger.Info("Error loading Event Time Table, re-creating table");
                
                WorldBossEventTimeTable.CreateTable(isAdjustedBossTimersTable);
                this.WorldBossEventTimeTable = WorldBossEventTimeTable.LoadTable(isAdjustedBossTimersTable);
            }

            logger.Info("Loading Meta Events Data Table");
            try
            {
                this.MetaEventsTable = MetaEventsTable.LoadTable();
            }
            catch (Exception ex)
            {
                logger.Error(ex);
                logger.Info("Error loading Event Time Table, re-creating table");

                MetaEventsTable.CreateTable();
                this.MetaEventsTable = MetaEventsTable.LoadTable();
            }
        }

Usage Example

        public void EventsService_LoadTable_Adjusted_Success()
        {
            EventsService es = new EventsService();

            var sw = new Stopwatch();
            sw.Start();
            es.LoadTables(true);
            sw.Stop();
            Console.WriteLine("{0}ms", sw.ElapsedMilliseconds);

            Assert.IsNotNull(es.WorldBossEventTimeTable);
            Assert.IsTrue(es.WorldBossEventTimeTable.WorldEvents.Count > 0);
        }
All Usage Examples Of GW2PAO.API.Services.EventsService::LoadTables