public YandexDirect(string login, string appId, string token, YandexApiLanguage lang = YandexApiLanguage.English) { this.login = login; try { this._ydc = new YandexDirectConfiguration(); this._ydc.AuthProvider = new TokenAuthProvider(login, appId, token); this._ydc.Language = lang; this._ydc.ServiceUrl = new Uri("https://api.direct.yandex.ru/live/v4/json/"); this._yds = new YandexDirectService(_ydc); Console.WriteLine("Подключились к Forecast"); } catch (Exception e) { Task.Run(() => (new SelfRestarter(TimeSpan.FromSeconds(25))).execute()); } }
public YandexDirect(string login, string appId, string token, YandexApiLanguage lang = YandexApiLanguage.English) { this.login = login; try { this._ydc = new YandexDirectConfiguration(); this._ydc.AuthProvider = new TokenAuthProvider(login, appId, token); this._ydc.Language = lang; this._ydc.ServiceUrl = new Uri("https://api.direct.yandex.ru/live/v4/json/"); this._yds = new YandexDirectService(_ydc); Console.WriteLine("Подключились к Forecast"); } catch (Exception e) { Console.WriteLine(e.Message); } }
public YandexDirectConfiguration(IYandexApiAuthProvider authProvider, YandexApiLanguage language) : this() { AuthProvider = authProvider; Language = language; }
public YandexDirectService(IYandexApiAuthProvider authProvider, YandexApiLanguage language) : this(new YandexDirectConfiguration(authProvider, language)) { }