static MessageHandler( ) { YandexClient yandexMC = new YandexClient( ); SpotifyClient SC = new SpotifyClient( ); YoutubeClient youtubeMC = new YoutubeClient( ); Clients.Add(yandexMC.Name, yandexMC); Clients.Add(SC.Name, SC); Clients.Add(youtubeMC.Name, youtubeMC); }
private YandexClient SetUpYandexClient() { var services = SetUpYandexServiceCollection(); var httpClient = SetUpYandexHttpClient(); var nullLogger = Microsoft.Extensions.Logging.Abstractions.NullLogger <YandexClient> .Instance; var serviceProvider = services.BuildServiceProvider(); var mapper = serviceProvider.GetRequiredService <IMapper>(); var yandexClient = new YandexClient(httpClient, serviceProvider.GetRequiredService <YandexClientSettings>(), mapper, nullLogger); return(yandexClient); }
private void Yandexauthwindow_Loaded(object sender, RoutedEventArgs e) { var client = new YandexClient ( "ef69cea3cf4946d0b00dec064f1b26ee", "9446b005f22f4a5592b5a78d250551d2" ); if (!OAuthManager.IsRegisteredClient("Yandex")) { OAuthManager.RegisterClient ( client ); } yandexweb.Navigate(source: OAuthWeb.GetAuthorizationUrl("Yandex")); }
/// <summary> /// Initializes a new instance of the login form with a specified OAuth client. /// </summary> /// <param name="client">Instance of the OAuth client.</param> /// <param name="autoLogout">Disables saving and restoring authorization cookies in WebBrowser. Default: false.</param> /// <param name="loadUserInfo">Indicates the need to make a request for recive the user profile or not. Default: false.</param> /// <param name="responseType">Allows to set the type of response that is expected from the server. Default: <see cref="ResponseType.Token"/>.</param> public YandexLogin(YandexClient client, bool autoLogout = false, bool loadUserInfo = false, string responseType = "token") : base(client, autoLogout, loadUserInfo, responseType) { this.Width = 690; this.Height = 655; this.Icon = Properties.Resources.yandex; }