public GiphyHandler(IGiphyClient client) { if (client == null) { throw new ArgumentNullException("client"); } _client = client; }
/// <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); }
/// <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(); }
public StatusCodeService(IGiphyClient client) { _client = client; }
public GetGifQueryHandler(IGiphyClient client) { _client = client; }
public GiphyService(ILogger <GiphyService> logger, IGiphyClient giphyClient) { _logger = logger; _giphyClient = giphyClient; }
public GifSearchService(ILogger <GifSearchService> logger, IGiphyClient client) { Logger = logger; Client = client; }
public GiphyPostHandler(IGiphyClient i_GiphyClient, PictureBox i_PictureBoxPostSentPhoto) { m_PictureBoxPostSentPhoto = i_PictureBoxPostSentPhoto; m_GiphyClient = i_GiphyClient; }