Generate() публичный Метод

public Generate ( ) : string
Результат string
Пример #1
0
        public string DownloadZip(string tag, Transformation transform)
        {
            if (string.IsNullOrEmpty(tag))
            {
                throw new ArgumentException("Tag should be specified!");
            }
            var builder          = new UrlBuilder(Api.ApiUrlV.ResourceType("image").Action("download_tag.zip").BuildUrl());
            var sortedDictionary = new SortedDictionary <string, object>();

            sortedDictionary.Add("tag", tag);
            if (transform != null)
            {
                sortedDictionary.Add("transformation", transform.Generate());
            }
            return(GetDownloadUrl(builder, sortedDictionary));
        }
Пример #2
0
        /// <summary>
        /// Gets URL to download tag cloud as ZIP package
        /// </summary>
        /// <param name="tag">The tag.</param>
        /// <param name="transform">The transformation.</param>
        /// <returns></returns>
        /// <exception cref="System.ArgumentException">Tag should be specified!</exception>
        public string DownloadZip(string tag, Transformation transform)
        {
            if (String.IsNullOrEmpty(tag))
                throw new ArgumentException("Tag should be specified!");

            UrlBuilder urlBuilder = new UrlBuilder(
               m_api.ApiUrlV
               .ResourceType("image")
               .Action("download_tag.zip")
               .BuildUrl());

            var parameters = new SortedDictionary<string, object>();

            parameters.Add("tag", tag);

            if (transform != null)
                parameters.Add("transformation", transform.Generate());

            return GetDownloadUrl(urlBuilder, parameters);
        }