/// <summary> /// Creates a new Corporation. If the Key is initialized, the Corporation will also be initialized with data from the /// Key. /// </summary> /// <param name="apiKey">A CorporationKey</param> /// <param name="corporationId">A valid Eve Online Corporation ID</param> public Corporation(CorporationKey apiKey, long corporationId) { Contract.Requires(apiKey != null); ApiKey = apiKey; CorporationId = corporationId; if (ApiKey.IsInitialized) ensureInitialized(); }
public async Task <List <WalletTransactions.Transaction> > GetTransactionsCorpo(long keyid, string vcode, long corporationId, DateTime cutoffDate) { _logger.Debug("{method} {keyid}", "EveApi::GetTransactionsCorpo", keyid); var ck = new eZet.EveLib.EveXmlModule.CorporationKey(keyid, vcode); if (ck.Corporation == null) { throw new UserException(string.Format(strings.ErrorAuthenticationFailureWithKey, keyid)); } var result = new List <WalletTransactions.Transaction>(); long fromid = 0; for (;;) { var partial = await ck.Corporation.GetWalletTransactionsAsync(1000, 100, fromid); var toadd = partial.Result.Transactions.Where(x => x.TransactionDate > cutoffDate); if (toadd.Count() == 0) { break; } _logger.Debug("{method} Got {count} transaction entries", "EveApi::GetTransactionsCorpo", toadd.Count()); fromid = toadd.Min(x => x.TransactionId); result.AddRange(toadd); } return(result); }
/// <summary> /// Creates a new Corporation. If the Key is initialized, the Corporation will also be initialized with data from the /// Key. /// </summary> /// <param name="apiKey">A CorporationKey</param> /// <param name="corporationId">A valid Eve Online Corporation ID</param> public Corporation(CorporationKey apiKey, long corporationId) { Contract.Requires(apiKey != null); ApiKey = apiKey; CorporationId = corporationId; if (ApiKey.IsInitialized) { ensureInitialized(); } }
/// <summary> /// Creates a new Corporation, preserving the initialized data and key from the passed in entity /// </summary> /// <param name="apiKey"></param> /// <param name="entity"></param> internal Corporation(CorporationKey apiKey, ApiKeyInfo.ApiKeyEntity entity) { ApiKey = apiKey; CorporationId = entity.CorporationId; CorporationName = entity.CorporationName; AllianceId = entity.AllianceId; AllianceName = entity.AllianceName; FactionId = entity.FactionId; FactionName = entity.FactionName; BaseUri = apiKey.BaseUri; IsInitialized = true; }
/// <summary> /// Creates a new Corporation, preserving the initialized data and key from the passed in entity /// </summary> /// <param name="apiKey"></param> /// <param name="entity"></param> internal Corporation(CorporationKey apiKey, ApiKeyInfo.ApiKeyEntity entity) { ApiKey = apiKey; CorporationId = entity.CorporationId; CorporationName = entity.CorporationName; AllianceId = entity.AllianceId; AllianceName = entity.AllianceName; FactionId = entity.FactionId; FactionName = entity.FactionName; BaseUri = apiKey.BaseUri; IsInitialized = true; }
/// <summary> /// Creates a new corporation. This object will not be initialized. /// </summary> /// <param name="keyId"></param> /// <param name="vCode"></param> /// <param name="corporationId"></param> public Corporation(int keyId, string vCode, long corporationId) { ApiKey = new CorporationKey(keyId, vCode); CorporationId = corporationId; }
/// <summary> /// Creates a new corporation. This object will not be initialized. /// </summary> /// <param name="keyId"></param> /// <param name="vCode"></param> /// <param name="corporationId"></param> public Corporation(int keyId, string vCode, long corporationId) { ApiKey = new CorporationKey(keyId, vCode); CorporationId = corporationId; }