public virtual string CombineUrl(string url, bool checkProtocol, NameValueCollection unparsedParameters, out ICatalogItemContext newContext)
        {
            newContext = this;
            string text = new CatalogItemUrlBuilder(this).ToString();

            if (url == null)
            {
                return(text);
            }
            if (string.Compare(url, text, StringComparison.Ordinal) == 0)
            {
                return(text);
            }
            newContext = Combine(url, checkProtocol, externalFormat: true);
            if (newContext == null)
            {
                newContext = null;
                return(url);
            }
            CatalogItemUrlBuilder catalogItemUrlBuilder = new CatalogItemUrlBuilder(newContext);

            if (unparsedParameters != null)
            {
                catalogItemUrlBuilder.AppendUnparsedParameters(unparsedParameters);
            }
            return(catalogItemUrlBuilder.ToString());
        }
        public static CatalogItemUrlBuilder CreateNonServerBuilder(string serverVirtualFolderUrl, string itemPath, bool alreadyEscaped, bool addItemPathAsQuery)
        {
            CatalogItemUrlBuilder catalogItemUrlBuilder = new CatalogItemUrlBuilder(RSPathUtil.Instance);

            catalogItemUrlBuilder.Construct(serverVirtualFolderUrl, itemPath, alreadyEscaped, addItemPathAsQuery, isFolder: false);
            return(catalogItemUrlBuilder);
        }
Esempio n. 3
0
        public string GetImageUrl(bool useSessionId, string imageId, ICatalogItemContext ctx)
        {
            string text = null;

            if (m_renderingParameters != null)
            {
                text = m_renderingParameters["StreamRoot"];
            }
            if (text != null && text != string.Empty)
            {
                StringBuilder stringBuilder = new StringBuilder(text);
                if (imageId != null)
                {
                    stringBuilder.Append(imageId);
                }
                return(stringBuilder.ToString());
            }
            CatalogItemUrlBuilder catalogItemUrlBuilder = new CatalogItemUrlBuilder(ctx);
            string snapshotParamValue = SnapshotParamValue;

            if (snapshotParamValue != null)
            {
                catalogItemUrlBuilder.AppendCatalogParameter("Snapshot", snapshotParamValue);
            }
            string sessionIDParamValue = SessionIDParamValue;

            if (sessionIDParamValue != null)
            {
                catalogItemUrlBuilder.AppendCatalogParameter("SessionID", sessionIDParamValue);
            }
            else if (useSessionId && m_SessionId != null)
            {
                catalogItemUrlBuilder.AppendCatalogParameter("SessionID", m_SessionId);
            }
            string formatParamValue = FormatParamValue;

            if (formatParamValue != null)
            {
                catalogItemUrlBuilder.AppendCatalogParameter("Format", formatParamValue);
            }
            catalogItemUrlBuilder.AppendCatalogParameter("ImageID", imageId);
            return(catalogItemUrlBuilder.ToString());
        }