Пример #1
0
 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());
     }
 }
Пример #2
0
 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);
     }
 }
Пример #3
0
 public YandexDirectConfiguration(IYandexApiAuthProvider authProvider, YandexApiLanguage language)
     : this()
 {
     AuthProvider = authProvider;
     Language     = language;
 }
 public YandexDirectConfiguration(IYandexApiAuthProvider authProvider, YandexApiLanguage language)
     : this()
 {
     AuthProvider = authProvider;
     Language = language;
 }
Пример #5
0
 public YandexDirectService(IYandexApiAuthProvider authProvider, YandexApiLanguage language)
     : this(new YandexDirectConfiguration(authProvider, language))
 {
 }
Пример #6
0
 public YandexDirectService(IYandexApiAuthProvider authProvider, YandexApiLanguage language)
     : this(new YandexDirectConfiguration(authProvider, language))
 {
 }