Beispiel #1
0
        internal CorporationDataQuerying(CCPCharacter ccpCharacter)
        {
            m_ccpCharacter             = ccpCharacter;
            m_corporationQueryMonitors = new List <IQueryMonitorEx>(4);

            // Initializes the query monitors
            m_corpMedalsMonitor = new PagedQueryMonitor <EsiAPIMedals, EsiMedalsListItem>(
                new CorporationQueryMonitor <EsiAPIMedals>(ccpCharacter,
                                                           ESIAPICorporationMethods.CorporationMedals, OnMedalsUpdated,
                                                           EveMonClient.Notifications.NotifyCorporationMedalsError)
            {
                QueryOnStartup = true
            });
            // Add the monitors in an order as they will appear in the throbber menu
            m_corporationQueryMonitors.Add(m_corpMedalsMonitor);
            m_corpMarketOrdersMonitor = new PagedQueryMonitor <EsiAPIMarketOrders,
                                                               EsiOrderListItem>(new CorporationQueryMonitor <EsiAPIMarketOrders>(ccpCharacter,
                                                                                                                                  ESIAPICorporationMethods.CorporationMarketOrders, OnMarketOrdersUpdated,
                                                                                                                                  EveMonClient.Notifications.NotifyCorporationMarketOrdersError)
            {
                QueryOnStartup = true
            });
            m_corporationQueryMonitors.Add(m_corpMarketOrdersMonitor);
            m_corpContractsMonitor = new PagedQueryMonitor <EsiAPIContracts,
                                                            EsiContractListItem>(new CorporationQueryMonitor <EsiAPIContracts>(ccpCharacter,
                                                                                                                               ESIAPICorporationMethods.CorporationContracts, OnContractsUpdated,
                                                                                                                               EveMonClient.Notifications.NotifyCorporationContractsError)
            {
                QueryOnStartup = true
            });
            m_corporationQueryMonitors.Add(m_corpContractsMonitor);
            m_corpIndustryJobsMonitor = new PagedQueryMonitor <EsiAPIIndustryJobs,
                                                               EsiJobListItem>(new CorporationQueryMonitor <EsiAPIIndustryJobs>(
                                                                                   ccpCharacter, ESIAPICorporationMethods.CorporationIndustryJobs,
                                                                                   OnIndustryJobsUpdated, EveMonClient.Notifications.
                                                                                   NotifyCorporationIndustryJobsError)
            {
                QueryOnStartup = true
            });
            m_corporationQueryMonitors.Add(m_corpIndustryJobsMonitor);

            foreach (var monitor in m_corporationQueryMonitors)
            {
                ccpCharacter.QueryMonitors.Add(monitor);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CharacterDataQuerying"/> class.
        /// </summary>
        /// <param name="ccpCharacter">The CCP character.</param>
        internal CharacterDataQuerying(CCPCharacter ccpCharacter)
        {
            var notifiers = EveMonClient.Notifications;

            m_ccpCharacter           = ccpCharacter;
            m_characterQueryMonitors = new List <IQueryMonitorEx>();
            m_attrResponse           = null;
            m_lastQueue = null;

            // Add the monitors in an order as they will appear in the throbber menu
            m_charSheetMonitor = new CharacterQueryMonitor <EsiAPICharacterSheet>(ccpCharacter,
                                                                                  ESIAPICharacterMethods.CharacterSheet, OnCharacterSheetUpdated,
                                                                                  notifiers.NotifyCharacterSheetError);
            m_characterQueryMonitors.Add(m_charSheetMonitor);
            // Location
            m_characterQueryMonitors.Add(new CharacterQueryMonitor <EsiAPILocation>(
                                             ccpCharacter, ESIAPICharacterMethods.Location, OnCharacterLocationUpdated,
                                             notifiers.NotifyCharacterLocationError));
            // Clones
            m_characterQueryMonitors.Add(new CharacterQueryMonitor <EsiAPIClones>(
                                             ccpCharacter, ESIAPICharacterMethods.Clones, OnCharacterClonesUpdated,
                                             notifiers.NotifyCharacterClonesError));
            // Implants
            m_characterQueryMonitors.Add(new CharacterQueryMonitor <List <int> >(
                                             ccpCharacter, ESIAPICharacterMethods.Implants, OnCharacterImplantsUpdated,
                                             OnCharacterImplantsFailed));
            // Ship
            m_characterQueryMonitors.Add(new CharacterQueryMonitor <EsiAPIShip>(
                                             ccpCharacter, ESIAPICharacterMethods.Ship, OnCharacterShipUpdated,
                                             notifiers.NotifyCharacterShipError));
            // Skills
            m_charSkillsMonitor = new CharacterQueryMonitor <EsiAPISkills>(
                ccpCharacter, ESIAPICharacterMethods.Skills, OnCharacterSkillsUpdated,
                notifiers.NotifyCharacterSkillsError);
            m_characterQueryMonitors.Add(m_charSkillsMonitor);
            // Skill queue
            m_charSkillQueueMonitor = new CharacterQueryMonitor <EsiAPISkillQueue>(
                ccpCharacter, ESIAPICharacterMethods.SkillQueue, OnSkillQueueUpdated,
                notifiers.NotifySkillQueueError);
            m_characterQueryMonitors.Add(m_charSkillQueueMonitor);
            // Employment history
            m_characterQueryMonitors.Add(new CharacterQueryMonitor <EsiAPIEmploymentHistory>(
                                             ccpCharacter, ESIAPICharacterMethods.EmploymentHistory,
                                             OnCharacterEmploymentUpdated, notifiers.NotifyCharacterEmploymentError));
            // Standings
            m_characterQueryMonitors.Add(new PagedQueryMonitor <EsiAPIStandings,
                                                                EsiStandingsListItem>(new CharacterQueryMonitor <EsiAPIStandings>(
                                                                                          ccpCharacter, ESIAPICharacterMethods.Standings, OnStandingsUpdated,
                                                                                          notifiers.NotifyCharacterStandingsError)
            {
                QueryOnStartup = true
            }));
            // Contacts
            m_characterQueryMonitors.Add(new PagedQueryMonitor <EsiAPIContactsList,
                                                                EsiContactListItem>(new CharacterQueryMonitor <EsiAPIContactsList>(ccpCharacter,
                                                                                                                                   ESIAPICharacterMethods.ContactList, OnContactsUpdated,
                                                                                                                                   notifiers.NotifyCharacterContactsError)
            {
                QueryOnStartup = true
            }));
            // Factional warfare
            m_characterQueryMonitors.Add(new CharacterQueryMonitor <EsiAPIFactionalWarfareStats>(
                                             ccpCharacter, ESIAPICharacterMethods.FactionalWarfareStats,
                                             OnFactionalWarfareStatsUpdated, notifiers.
                                             NotifyCharacterFactionalWarfareStatsError)
            {
                QueryOnStartup = true
            });
            // Medals
            m_characterQueryMonitors.Add(new PagedQueryMonitor <EsiAPIMedals,
                                                                EsiMedalsListItem>(new CharacterQueryMonitor <EsiAPIMedals>(ccpCharacter,
                                                                                                                            ESIAPICharacterMethods.Medals, OnMedalsUpdated,
                                                                                                                            notifiers.NotifyCharacterMedalsError)
            {
                QueryOnStartup = true
            }));
            // Kill log
            m_characterQueryMonitors.Add(new PagedQueryMonitor <EsiAPIKillLog,
                                                                EsiKillLogListItem>(new CharacterQueryMonitor <EsiAPIKillLog>(ccpCharacter,
                                                                                                                              ESIAPICharacterMethods.KillLog, OnKillLogUpdated,
                                                                                                                              notifiers.NotifyCharacterKillLogError)
            {
                QueryOnStartup = true
            }));
            // Assets
            m_characterQueryMonitors.Add(new PagedQueryMonitor <EsiAPIAssetList,
                                                                EsiAssetListItem>(new CharacterQueryMonitor <EsiAPIAssetList>(ccpCharacter,
                                                                                                                              ESIAPICharacterMethods.AssetList, OnAssetsUpdated,
                                                                                                                              notifiers.NotifyCharacterAssetsError)
            {
                QueryOnStartup = true
            }));
            // Market orders
            m_charMarketOrdersMonitor = new CharacterQueryMonitor <EsiAPIMarketOrders>(
                ccpCharacter, ESIAPICharacterMethods.MarketOrders, OnMarketOrdersUpdated,
                notifiers.NotifyCharacterMarketOrdersError)
            {
                QueryOnStartup = true
            };
            m_characterQueryMonitors.Add(m_charMarketOrdersMonitor);
            // Contracts
            m_charContractsMonitor = new PagedQueryMonitor <EsiAPIContracts,
                                                            EsiContractListItem>(new CharacterQueryMonitor <EsiAPIContracts>(ccpCharacter,
                                                                                                                             ESIAPICharacterMethods.Contracts, OnContractsUpdated,
                                                                                                                             notifiers.NotifyCharacterContractsError)
            {
                QueryOnStartup = true
            });
            m_characterQueryMonitors.Add(m_charContractsMonitor);
            // Wallet journal
            m_characterQueryMonitors.Add(new PagedQueryMonitor <EsiAPIWalletJournal,
                                                                EsiWalletJournalListItem>(new CharacterQueryMonitor <EsiAPIWalletJournal>(
                                                                                              ccpCharacter, ESIAPICharacterMethods.WalletJournal, OnWalletJournalUpdated,
                                                                                              notifiers.NotifyCharacterWalletJournalError)
            {
                QueryOnStartup = true
            }));
            // Wallet balance
            m_characterQueryMonitors.Add(new CharacterQueryMonitor <string>(
                                             ccpCharacter, ESIAPICharacterMethods.AccountBalance, OnWalletBalanceUpdated,
                                             notifiers.NotifyCharacterBalanceError));
            // Wallet transactions
            m_characterQueryMonitors.Add(new PagedQueryMonitor <EsiAPIWalletTransactions,
                                                                EsiWalletTransactionsListItem>(new CharacterQueryMonitor <
                                                                                                   EsiAPIWalletTransactions>(ccpCharacter, ESIAPICharacterMethods.
                                                                                                                             WalletTransactions, OnWalletTransactionsUpdated, notifiers.
                                                                                                                             NotifyCharacterWalletTransactionsError)
            {
                QueryOnStartup = true
            }));
            // Industry
            m_charIndustryJobsMonitor = new CharacterQueryMonitor <EsiAPIIndustryJobs>(
                ccpCharacter, ESIAPICharacterMethods.IndustryJobs, OnIndustryJobsUpdated,
                notifiers.NotifyCharacterIndustryJobsError)
            {
                QueryOnStartup = true
            };
            m_characterQueryMonitors.Add(m_charIndustryJobsMonitor);
            // Research points
            m_characterQueryMonitors.Add(new CharacterQueryMonitor <EsiAPIResearchPoints>(
                                             ccpCharacter, ESIAPICharacterMethods.ResearchPoints, OnResearchPointsUpdated,
                                             notifiers.NotifyCharacterResearchPointsError)
            {
                QueryOnStartup = true
            });
            // Mail
            m_characterQueryMonitors.Add(new CharacterQueryMonitor <EsiAPIMailMessages>(
                                             ccpCharacter, ESIAPICharacterMethods.MailMessages, OnEVEMailMessagesUpdated,
                                             notifiers.NotifyEVEMailMessagesError)
            {
                QueryOnStartup = true
            });
            // Mailing lists
            m_characterQueryMonitors.Add(new CharacterQueryMonitor <EsiAPIMailingLists>(
                                             ccpCharacter, ESIAPICharacterMethods.MailingLists, OnEveMailingListsUpdated,
                                             notifiers.NotifyMailingListsError));
            // Notifications
            m_characterQueryMonitors.Add(new CharacterQueryMonitor <EsiAPINotifications>(
                                             ccpCharacter, ESIAPICharacterMethods.Notifications, OnEVENotificationsUpdated,
                                             notifiers.NotifyEVENotificationsError)
            {
                QueryOnStartup = true
            });
            // Calendar
            m_characterQueryMonitors.Add(new CharacterQueryMonitor <EsiAPICalendarEvents>(
                                             ccpCharacter, ESIAPICharacterMethods.UpcomingCalendarEvents,
                                             OnUpcomingCalendarEventsUpdated, notifiers.
                                             NotifyCharacterUpcomingCalendarEventsError)
            {
                QueryOnStartup = true
            });
            // PI
            m_characterQueryMonitors.Add(new CharacterQueryMonitor <EsiAPIPlanetaryColoniesList>(
                                             ccpCharacter, ESIAPICharacterMethods.PlanetaryColonies,
                                             OnPlanetaryColoniesUpdated, notifiers.
                                             NotifyCharacterPlanetaryColoniesError)
            {
                QueryOnStartup = true
            });
            m_characterQueryMonitors.ForEach(monitor => ccpCharacter.QueryMonitors.Add(monitor));

            // Enumerate the basic feature monitors into a separate list
            m_basicFeaturesMonitors = new List <IQueryMonitorEx>(m_characterQueryMonitors.Count);
            long basicFeatures = (long)CCPAPIMethodsEnum.BasicCharacterFeatures;

            foreach (var monitor in m_characterQueryMonitors)
            {
                long method = (long)(ESIAPICharacterMethods)monitor.Method;
                if (method == (method & basicFeatures))
                {
                    m_basicFeaturesMonitors.Add(monitor);
                    // If force update is selected, update basic features only
                    if (ccpCharacter.ForceUpdateBasicFeatures)
                    {
                        monitor.ForceUpdate(true);
                    }
                }
            }

            EveMonClient.TimerTick += EveMonClient_TimerTick;
        }