internal override CodeExpression BuildStringPropertyExpression(PropertyEntry pse)
 {
     if ((pse.PropertyInfo != null) && (Attribute.GetCustomAttribute(pse.PropertyInfo, typeof(UrlPropertyAttribute)) is UrlPropertyAttribute))
     {
         if (pse is SimplePropertyEntry)
         {
             SimplePropertyEntry entry = (SimplePropertyEntry)pse;
             string virtualPath        = (string)entry.Value;
             if (UrlPath.IsRelativeUrl(virtualPath) && !UrlPath.IsAppRelativePath(virtualPath))
             {
                 entry.Value = UrlPath.MakeVirtualPathAppRelative(UrlPath.Combine(this._themeParser.VirtualDirPath.VirtualPathString, virtualPath));
             }
         }
         else
         {
             ComplexPropertyEntry  entry2  = (ComplexPropertyEntry)pse;
             StringPropertyBuilder builder = (StringPropertyBuilder)entry2.Builder;
             string str2 = (string)builder.BuildObject();
             if (UrlPath.IsRelativeUrl(str2) && !UrlPath.IsAppRelativePath(str2))
             {
                 entry2.Builder = new StringPropertyBuilder(UrlPath.MakeVirtualPathAppRelative(UrlPath.Combine(this._themeParser.VirtualDirPath.VirtualPathString, str2)));
             }
         }
     }
     return(base.BuildStringPropertyExpression(pse));
 }
Exemple #2
0
        internal override CodeExpression BuildStringPropertyExpression(PropertyEntry pse)
        {
            // Make the UrlProperty based on virtualDirPath for control themes.
            if (pse.PropertyInfo != null)
            {
                UrlPropertyAttribute urlAttrib = Attribute.GetCustomAttribute(pse.PropertyInfo, typeof(UrlPropertyAttribute)) as UrlPropertyAttribute;

                if (urlAttrib != null)
                {
                    if (pse is SimplePropertyEntry)
                    {
                        SimplePropertyEntry spse = (SimplePropertyEntry)pse;

                        string strValue = (string)spse.Value;
                        if (UrlPath.IsRelativeUrl(strValue) && !UrlPath.IsAppRelativePath(strValue))
                        {
                            spse.Value = UrlPath.MakeVirtualPathAppRelative(UrlPath.Combine(_themeParser.VirtualDirPath.VirtualPathString, strValue));
                        }
                    }
                    else
                    {
                        Debug.Assert(pse is ComplexPropertyEntry);
                        ComplexPropertyEntry  cpe     = (ComplexPropertyEntry)pse;
                        StringPropertyBuilder builder = (StringPropertyBuilder)cpe.Builder;

                        string strValue = (string)builder.BuildObject();
                        if (UrlPath.IsRelativeUrl(strValue) && !UrlPath.IsAppRelativePath(strValue))
                        {
                            cpe.Builder = new StringPropertyBuilder(UrlPath.MakeVirtualPathAppRelative(UrlPath.Combine(_themeParser.VirtualDirPath.VirtualPathString, strValue)));
                        }
                    }
                }
            }

            return(base.BuildStringPropertyExpression(pse));
        }