示例#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))
 {
 }
 public YandexDirectService(IYandexApiAuthProvider authProvider, YandexApiLanguage language)
     : this(new YandexDirectConfiguration(authProvider, language))
 {
 }