Exemple #1
0
        private string GetFormattedArticlesUri(string resourceUrl, ArticleSortingOptions options, ArticleSideLoadOptionsEnum sideloadOptions)
        {
            if (options != null)
            {
                if (string.IsNullOrEmpty(options.Locale))
                {
                    throw new ArgumentException("Locale is required to sort");
                }

                resourceUrl = options.GetSortingString(resourceUrl);
            }

            string sideLoads = sideloadOptions.ToString().ToLower().Replace(" ", "");

            if (sideloadOptions != ArticleSideLoadOptionsEnum.None)
            {
                resourceUrl += resourceUrl.Contains("?") ? "&include=" : "?include=";

                //Categories flag REQUIRES sections to be added as well, or nothing will be returned
                if (sideloadOptions.HasFlag(ArticleSideLoadOptionsEnum.Categories) && !sideloadOptions.HasFlag(ArticleSideLoadOptionsEnum.Sections))
                {
                    sideLoads += string.Format(",{0}", ArticleSideLoadOptionsEnum.Sections.ToString().ToLower());
                }

                resourceUrl += sideLoads;
            }
            return(resourceUrl);
        }
Exemple #2
0
        private string GetFormattedArticleUri(string resourceUrl, ArticleSideLoadOptionsEnum sideloadOptions)
        {
            string sideLoads = sideloadOptions.ToString().ToLower().Replace(" ", "");

            if (sideloadOptions != ArticleSideLoadOptionsEnum.None)
            {
                resourceUrl += resourceUrl.Contains("?") ? "&include=" : "?include=";

                //Categories flag REQUIRES sections to be added as well, or nothing will be returned
                if (sideloadOptions.HasFlag(ArticleSideLoadOptionsEnum.Categories) && !sideloadOptions.HasFlag(ArticleSideLoadOptionsEnum.Sections))
                {
                    sideLoads += string.Format(",{0}", ArticleSideLoadOptionsEnum.Sections.ToString().ToLower());
                }

                resourceUrl += sideLoads;
            }
            return(resourceUrl);
        }
Exemple #3
0
        private string GetFormattedArticleUri(string resourceUrl, ArticleSideLoadOptionsEnum sideloadOptions)
        {

            string sideLoads = sideloadOptions.ToString().ToLower().Replace(" ", "");
            if (sideloadOptions != ArticleSideLoadOptionsEnum.None)
            {
                resourceUrl += resourceUrl.Contains("?") ? "&include=" : "?include=";

                //Categories flag REQUIRES sections to be added as well, or nothing will be returned
                if (sideloadOptions.HasFlag(ArticleSideLoadOptionsEnum.Categories) && !sideloadOptions.HasFlag(ArticleSideLoadOptionsEnum.Sections))
                {
                    sideLoads += string.Format(",{0}", ArticleSideLoadOptionsEnum.Sections.ToString().ToLower());
                }

                resourceUrl += sideLoads;
            }
            return resourceUrl;
        }
Exemple #4
0
        private string GetFormattedArticlesUri(string resourceUrl, ArticleSortingOptions options, ArticleSideLoadOptionsEnum sideloadOptions)
        {
            if (options != null)
            {
                if (string.IsNullOrEmpty(options.Locale))
                    throw new ArgumentException("Locale is required to sort");

                resourceUrl = options.GetSortingString(resourceUrl);
            }

            string sideLoads = sideloadOptions.ToString().ToLower().Replace(" ", "");
            if (sideloadOptions != ArticleSideLoadOptionsEnum.None)
            {
                resourceUrl += resourceUrl.Contains("?") ? "&include=" : "?include=";

                //Categories flag REQUIRES sections to be added as well, or nothing will be returned
                if (sideloadOptions.HasFlag(ArticleSideLoadOptionsEnum.Categories) && !sideloadOptions.HasFlag(ArticleSideLoadOptionsEnum.Sections))
                {
                    sideLoads += string.Format(",{0}", ArticleSideLoadOptionsEnum.Sections.ToString().ToLower());
                }

                resourceUrl += sideLoads;
            }
            return resourceUrl;
        }