Exemplo n.º 1
0
        public GiphyHandler(IGiphyClient client)
        {
            if (client == null)
            {
                throw new ArgumentNullException("client");
            }

            _client = client;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initialize post handlers (chain of responsibility)
        /// </summary>
        /// <returns></returns>
        private PostHandlerBase intializePostsPublishChain(IGiphyClient i_GiffyClient, ISentimentClient i_SentimentClient)
        {
            SentimentPostHandler sentimentHandler   = new SentimentPostHandler(i_SentimentClient);
            GiphyPostHandler     giffyHandler       = new GiphyPostHandler(i_GiffyClient, pictureBox_PostSentPhoto);
            PublishPostHandler   publishPostHandler = new PublishPostHandler();

            sentimentHandler.SetSuccessor(giffyHandler);
            giffyHandler.SetSuccessor(publishPostHandler);

            return(sentimentHandler);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Initialize posts user control asynchronously
        /// </summary>
        /// <param name="i_GiffyClient">Retrieves a random gif which suites your phrase</param>
        /// <param name="i_SentimentClient">Analyzes the sentiment context of your post, and can help you keep positive</param>
        /// <returns></returns>
        public async Task Initialize(IGiphyClient i_GiffyClient, ISentimentClient i_SentimentClient)
        {
            m_PostsHandlersChain = intializePostsPublishChain(i_GiffyClient, i_SentimentClient);

            // Load my picture and detials
            string url = await FacebookApiClient.Instance.GetLoggedInUserPictureUrlAsync();

            picture_myPictureBox.LoadAsync(url);
            label_MyName.Text = await FacebookApiClient.Instance.GetLoggedInUserNameAsync();

            label_FriendsCount.Text = (await FacebookApiClient.Instance.GetFriendsAsync()).Count.ToString();
            label_EventsCount.Text  = (await FacebookApiClient.Instance.GetEventsAsync()).Count.ToString();

            // Load my post
            await loadMyPosts();

            // Load my active friends
            await setActiveFriendsAsync();

            // load events
            await loadEventsTextAsync();
        }
Exemplo n.º 4
0
 public StatusCodeService(IGiphyClient client)
 {
     _client = client;
 }
 public GetGifQueryHandler(IGiphyClient client)
 {
     _client = client;
 }
Exemplo n.º 6
0
 public GiphyService(ILogger <GiphyService> logger, IGiphyClient giphyClient)
 {
     _logger      = logger;
     _giphyClient = giphyClient;
 }
Exemplo n.º 7
0
 public GifSearchService(ILogger <GifSearchService> logger, IGiphyClient client)
 {
     Logger = logger;
     Client = client;
 }
Exemplo n.º 8
0
 public GiphyPostHandler(IGiphyClient i_GiphyClient, PictureBox i_PictureBoxPostSentPhoto)
 {
     m_PictureBoxPostSentPhoto = i_PictureBoxPostSentPhoto;
     m_GiphyClient             = i_GiphyClient;
 }