/// <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; } }
/// <summary> /// Exports the industry jobs. /// </summary> /// <returns></returns> private IEnumerable <SerializableJob> IndustryJobsExport() { // Until we can determine what data the character's API keys can query, // we have to keep the data unprocessed. Once we know, we filter them IEnumerable <SerializableJob> corporationIndustryJobsExport = EveMonClient.ESIKeys.Any(apiKey => !apiKey.IsProcessed) || m_corporationDataQuerying != null ? CorporationIndustryJobs.ExportOnlyIssuedByCharacter() : new List <SerializableJob>(); IEnumerable <SerializableJob> characterIndustryJobsExport = EveMonClient.ESIKeys.Any(apiKey => !apiKey.IsProcessed) || m_characterDataQuerying != null ? CharacterIndustryJobs.Export() : new List <SerializableJob>(); return(characterIndustryJobsExport.Concat(corporationIndustryJobsExport)); }
/// <summary> /// Imports the industry jobs. /// </summary> /// <param name="industryJobs">The industry jobs.</param> private void IndustryJobsImport(IList <SerializableJob> industryJobs) { CharacterIndustryJobs.Import(industryJobs.Where(job => job.IssuedFor == IssuedFor.Character)); CorporationIndustryJobs.Import(industryJobs.Where(job => job.IssuedFor == IssuedFor.Corporation)); }