Exemplo n.º 1
0
        private string GenerateUrl(string userId, YouTubeEncoding encoding, int maxLength, bool isPopular)
        {
            userId = WebUtility.UrlEncode(userId);
            var selectedItem = ComboBox.SelectedItem as ListBoxItem;

            if (Equals(selectedItem, UserNameItem))
            {
                return($"{_baseAddress}/GetUserFeed?userId={userId}&encoding={encoding}&maxLength={maxLength}&isPopular={isPopular}");
            }

            if (Equals(selectedItem, PlaylistItem))
            {
                return($"{_baseAddress}/GetPlaylistFeed?playlistId={userId}&encoding={encoding}&maxLength={maxLength}&isPopular={isPopular}");
            }

            return(null);
        }
Exemplo n.º 2
0
        private string GenerateUrl(string userId, YouTubeEncoding encoding, int maxLength, bool isPopular)
        {
            userId = WebUtility.UrlEncode(userId);
            var selectedItem = ComboBox.SelectedItem as ListBoxItem;
            if (Equals(selectedItem, UserNameItem))
            {
                return $"{_baseAddress}/GetUserFeed?userId={userId}&encoding={encoding}&maxLength={maxLength}&isPopular={isPopular}";
            }

            if (Equals(selectedItem, PlaylistItem))
            {
                return $"{_baseAddress}/GetPlaylistFeed?playlistId={userId}&encoding={encoding}&maxLength={maxLength}&isPopular={isPopular}";
            }

            return null;
        }