Example #1
0
        private async void btnSearch_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(BookTitle))
            {
                return;
            }

            _isLoading = true;
            var client      = new GoogleBooksClient();
            var booksResult = await client.SearchBookByTitle(BookTitle);

            VolumesInfo = new ObservableCollection <VolumeInfo>(booksResult);
            _isLoading  = false;
        }
Example #2
0
 public SlackRequestProcessor()
 {
     _triggerWordMap = new Dictionary <CommandType, Func <SlackResponse> >
     {
         { CommandType.Help, Help },
         { CommandType.Info, Info },
         { CommandType.SetProjectId, SetProjectId },
         { CommandType.AddTasks, AddTasks },
         { CommandType.AddStory, AddStory },
         { CommandType.AddDefaultTask, AddDefaultTask },
         { CommandType.ClearDefaultTasks, ClearDefaultTasks },
         { CommandType.SetDefaultTasksFromJson, SetDefaultTasksFromJson },
         { CommandType.RandomFractal, RandomFractal },
         { CommandType.AddCats, AddCats },
         { CommandType.YouTube, YouTube },
         { CommandType.Imgur, Imgur },
         { CommandType.GoogleBooks, GoogleBooks },
         { CommandType.GoogleVision, GoogleVision },
         { CommandType.SendText, SendText },
         { CommandType.SearchRepos, SearchRepos }
     };
     _databaseClient = !string.IsNullOrEmpty(ConfigurationManager.AppSettings["SqlConnectionString"])
         ? (IDatabaseClient) new SqlDatabaseClient()
         : new RavenDatabaseClient();
     _pivotalClient      = new PivotalClient();
     _fractalClient      = new FractalClient();
     _bitlyClient        = new BitlyClient();
     _catApiClient       = new CatApiClient();
     _imgurClient        = new ImgurClient();
     _youTubeClient      = new YouTubeClient();
     _googleVisionClient = new GoogleVisionClient();
     _googleBooksClient  = new GoogleBooksClient();
     _textBeltClient     = new TextBeltClient();
     _gitHubClient       = new GitHubClient();
     _validator          = new RequestValidator();
 }