public string this[string columnName] { get { switch (columnName) { case "ApiKey": if (!string.IsNullOrEmpty(ApiKey)) { MarketApi marketApi = new MarketApi(ApiKey); try { marketApi.StartPing(); var balance = marketApi.GetBalance(); KeyIsFinded = "Ключ валидный"; Balance = balance.Result; KeyContorller.SaveKey(ApiKey); } catch { KeyIsFinded = "Ключ не валидный"; Balance = ""; } break; } else { var ApiKeyWithFile = KeyContorller.LoadKey(); if (string.IsNullOrWhiteSpace(ApiKey)) { ApiKey = ApiKeyWithFile; } } break; } return(_KeyIsFinded); } }