public void SetApiKeyToUI(EveApiKey activeKey)
 {
     txtAccountName.Text = activeKey.Name;
     txtKeyId.Text = activeKey.KeyId.ToString();
     txtVcode.Text = activeKey.VCode;
     txtCharacterId.Text = activeKey.CharacterId.ToString();
 }
        public void Update(EveApiKey row)
        {
            var itemInList = rows.FirstOrDefault(x => x.KeyId == row.KeyId);
            if (itemInList == null)
                return;

            row.DeepCopyTo(itemInList);
            RaiseCollectionChanged(NotifyCollectionChangedAction.Replace);
        }
        public void Remove(EveApiKey row)
        {
            var itemInList = rows.FirstOrDefault(x => x.KeyId == row.KeyId);
            if (itemInList == null)
                return;

            rows.Remove(itemInList);
            RaiseCollectionChanged(NotifyCollectionChangedAction.Remove);
        }
Exemplo n.º 4
0
 public void DeepCopyTo(EveApiKey key)
 {
     key.KeyId = this.KeyId;
     key.VCode = this.VCode;
     key.CharacterId = this.CharacterId;
     key.AccessType = this.AccessType;
     key.AccountStatus = this.AccountStatus;
     key.Name = this.Name;
     key.IsCorp = this.IsCorp;
 }
        public EveApiKey GetApiKeyFromUI()
        {
            var newApiKey = new EveApiKey();

            newApiKey.KeyId = CommonUtils.GetLongFromString(txtKeyId.Text.Trim());
            newApiKey.VCode = txtVcode.Text.Trim();
            newApiKey.Name = txtAccountName.Text.Trim();
            newApiKey.CharacterId = CommonUtils.GetLongFromString(txtCharacterId.Text.Trim());

            return newApiKey;
        }
Exemplo n.º 6
0
        private static void InitApiKeys()
        {
            // Check Accounts.json
            var isExists = File.Exists(Consts.FileNameAccounts);
            if( !isExists )
            {
                _apiKeys = new List<EveApiKey>();
                // Add test key
                var apiKey = new EveApiKey {KeyId = 12312, VCode ="xxxx", Name = "Test Account"};
                _apiKeys.Add(apiKey);

                return;
            }

            // If exists - load data
            var fl = new JsonFile<List<EveApiKey>> {FileName = Consts.FileNameAccounts};
            fl.OpenAndRead();
            _apiKeys = fl.GetObject();
        }
Exemplo n.º 7
0
 public object Clone()
 {
     var clone = new EveApiKey();
     DeepCopyTo(clone);
     return clone;
 }
Exemplo n.º 8
0
 public bool CheckApiKey(EveApiKey apiKey)
 {
     var anonApi = new EveApi(apiKey.KeyId, apiKey.VCode);
     return anonApi.GetAccountEntries().Count > 0;
 }
 public void Add(EveApiKey row)
 {
     rows.Add(row);
     RaiseCollectionChanged(NotifyCollectionChangedAction.Add);
 }
Exemplo n.º 10
0
 private void AddApiKeyToList(EveApiKey newApiKey)
 {
     apiKeysCollection.Add(newApiKey);
 }
Exemplo n.º 11
0
 private void UpdateApiKeyStatusInGrid(EveApiKey account, int i)
 {
 }
Exemplo n.º 12
0
 private void UpdateApiKeyInList(EveApiKey account)
 {
     apiKeysCollection.Update(account);
 }