Exemple #1
0
        public static ReportUrl BuildHyperlinkUrl(RenderingContext renderingContext, ObjectType objectType, string objectName, string propertyName, ICatalogItemContext itemContext, string initialUrl)
        {
            ReportUrl result = null;

            if (initialUrl == null)
            {
                return(null);
            }
            bool flag = false;

            try
            {
                string text  = initialUrl;
                bool   flag2 = default(bool);
                bool   flag3 = itemContext.IsReportServerPathOrUrl(text, false, out flag2);
                NameValueCollection unparsedParameters = null;
                if (flag3 && flag2)
                {
                    itemContext.PathManager.ExtractFromUrl(text, out text, out unparsedParameters);
                    if (text == null || text.Length == 0)
                    {
                        flag   = true;
                        text   = null;
                        result = null;
                    }
                }
                if (text != null)
                {
                    result = new ReportUrl(itemContext, text, false, unparsedParameters);
                }
            }
            catch (ItemNotFoundException)
            {
                flag = true;
            }
            catch (RenderingObjectModelException)
            {
                flag = true;
            }
            catch (RSException)
            {
                throw;
            }
            catch (Exception)
            {
                flag = true;
            }
            if (flag)
            {
                renderingContext.OdpContext.ErrorContext.Register(ProcessingErrorCode.rsInvalidURLProtocol, Severity.Warning, objectType, objectName, propertyName, initialUrl.MarkAsPrivate());
            }
            return(result);
        }
        internal static ReportUrl BuildHyperlinkUrl(RenderingContext renderingContext, ObjectType objectType, string objectName, string propertyName, ICatalogItemContext itemContext, string initialUrl)
        {
            ReportUrl result = null;

            if (initialUrl == null)
            {
                return(null);
            }
            bool flag = false;

            try
            {
                string path = initialUrl;
                bool   isRelative;
                bool   num = itemContext.IsReportServerPathOrUrl(path, protocolRestriction: false, out isRelative);
                NameValueCollection queryParameters = null;
                if (num && isRelative)
                {
                    itemContext.PathManager.ExtractFromUrl(path, out path, out queryParameters);
                    if (path == null || path.Length == 0)
                    {
                        flag   = true;
                        path   = null;
                        result = null;
                    }
                }
                if (path != null)
                {
                    result = new ReportUrl(itemContext, path, checkProtocol: false, queryParameters);
                }
            }
            catch (ItemNotFoundException)
            {
                flag = true;
            }
            catch (RenderingObjectModelException)
            {
                flag = true;
            }
            catch (RSException)
            {
                throw;
            }
            catch (Exception)
            {
                flag = true;
            }
            if (flag)
            {
                renderingContext.OdpContext.ErrorContext.Register(ProcessingErrorCode.rsInvalidURLProtocol, Severity.Warning, objectType, objectName, propertyName, initialUrl.MarkAsPrivate());
            }
            return(result);
        }