Esempio n. 1
0
        /// <summary>
        /// Handles the APIKeyInfoUpdated event of the EveMonClient control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void EveMonClient_APIKeyInfoUpdated(object sender, EventArgs e)
        {
            if (EveMonClient.APIKeys.Any(apiKey => !apiKey.IsProcessed))
            {
                return;
            }

            if (!Identity.APIKeys.Any() || Identity.APIKeys.Any(apiKey => apiKey.Type == CCPAPIKeyType.Unknown))
            {
                return;
            }

            if (m_characterDataQuerying == null && Identity.APIKeys.Any(apiKey => apiKey.IsCharacterOrAccountType))
            {
                m_characterDataQuerying = new CharacterDataQuerying(this);
                ResetLastAPIUpdates(m_lastAPIUpdates.Where(lastUpdate => Enum.IsDefined(typeof(CCPAPICharacterMethods),
                                                                                        lastUpdate.Method)));
            }

            if (m_corporationDataQuerying == null && Identity.APIKeys.Any(apiKey => apiKey.IsCorporationType))
            {
                m_corporationDataQuerying = new CorporationDataQuerying(this);
                ResetLastAPIUpdates(m_lastAPIUpdates.Where(lastUpdate => Enum.IsDefined(typeof(CCPAPICorporationMethods),
                                                                                        lastUpdate.Method)));
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Handles the ESIKeyInfoUpdated event of the EveMonClient control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void EveMonClient_ESIKeyInfoUpdated(object sender, EventArgs e)
        {
            if (EveMonClient.ESIKeys.Any(apiKey => !apiKey.IsProcessed))
            {
                return;
            }

            if (!Identity.ESIKeys.Any())
            {
                return;
            }

            if (m_characterDataQuerying == null && Identity.ESIKeys.Any())
            {
                m_characterDataQuerying = new CharacterDataQuerying(this);
                ResetLastAPIUpdates(m_lastAPIUpdates.Where(lastUpdate => Enum.IsDefined(typeof(ESIAPICharacterMethods),
                                                                                        lastUpdate.Method)));
            }

            if (m_corporationDataQuerying == null && Identity.ESIKeys.Any())
            {
                m_corporationDataQuerying = new CorporationDataQuerying(this);
                ResetLastAPIUpdates(m_lastAPIUpdates.Where(lastUpdate => Enum.IsDefined(typeof(ESIAPICorporationMethods),
                                                                                        lastUpdate.Method)));
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Called when the object gets disposed.
        /// </summary>
        internal override void Dispose()
        {
            // Unsubscribe events
            EveMonClient.CharacterAssetsUpdated           -= EveMonClient_CharacterAssetsUpdated;
            EveMonClient.CharacterMarketOrdersUpdated     -= EveMonClient_CharacterMarketOrdersUpdated;
            EveMonClient.CorporationMarketOrdersUpdated   -= EveMonClient_CorporationMarketOrdersUpdated;
            EveMonClient.CharacterContractsUpdated        -= EveMonClient_CharacterContractsUpdated;
            EveMonClient.CorporationContractsUpdated      -= EveMonClient_CorporationContractsUpdated;
            EveMonClient.CharacterIndustryJobsUpdated     -= EveMonClient_CharacterIndustryJobsUpdated;
            EveMonClient.CorporationIndustryJobsUpdated   -= EveMonClient_CorporationIndustryJobsUpdated;
            EveMonClient.CharacterIndustryJobsCompleted   -= EveMonClient_CharacterIndustryJobsCompleted;
            EveMonClient.CorporationIndustryJobsCompleted -= EveMonClient_CorporationIndustryJobsCompleted;
            EveMonClient.CharacterPlaneteryPinsCompleted  -= EveMonClient_CharacterPlaneteryPinsCompleted;
            EveMonClient.APIKeyInfoUpdated -= EveMonClient_APIKeyInfoUpdated;
            EveMonClient.TimerTick         -= EveMonClient_TimerTick;

            // Unsubscribe events
            SkillQueue.Dispose();
            CharacterIndustryJobs.Dispose();
            CorporationIndustryJobs.Dispose();
            PlanetaryColonies.Dispose();

            // Unsubscribe events
            if (m_characterDataQuerying != null)
            {
                m_characterDataQuerying.Dispose();
                m_characterDataQuerying = null;
            }

            if (m_corporationDataQuerying != null)
            {
                m_corporationDataQuerying.Dispose();
                m_corporationDataQuerying = null;
            }
        }