예제 #1
0
 private void GenerateFakeInfo()
 {
     if (mEntityInfo.EntityID == 96181148)
     {
         mFakeEntityInfo = mEntityInfo;
     }
     else
     {
         mFakeEntityInfo = new UserCache.EntityInfo()
         {
             EntityType = EntityType.Character,
             EntityID   = 96181148,
             Name       = mNames[mRandom.Next(0, mNames.Length)]
         }
     };
 }
예제 #2
0
        private async Task GetMailingLists(MailApi api)
        {
            List <GetCharactersCharacterIdMailLists200Ok> list;

            try
            {
                list = await api.GetCharactersCharacterIdMailListsAsync(
                    characterId : (int)mDBAccount.CharacterId,
                    datasource : ESIConfiguration.DataSource,
                    token : mDBAccount.AccessToken);
            }
            catch (Eve.Api.Client.ApiException e)
            {
                ExceptionHandler.HandleApiException(null, e);
                return;
            }

            UserCache.EntityInfo[] info = new UserCache.EntityInfo[list.Count];
            int index = 0;

            foreach (var i in list)
            {
                if (!i.MailingListId.HasValue)
                {
                    continue;
                }
                info[index++] = new UserCache.EntityInfo()
                {
                    EntityType = EntityType.Mailinglist,
                    EntityID   = i.MailingListId.Value,
                    Name       = i.Name
                };
                var label = new Label(mClient, this, i.MailingListId.Value, i.Name, LabelType.MailingList);
                mLabels.Add(label);
                mLog.Info($"{this.UserName}: Added mailing list '{label.Name}'");
            }

            await UserCache.EntityLookupAsync.AddLookups(info);
        }