Author: juraj
Date: 2007-12-14 08:47:00 -0500 (Fri, 14 Dec 2007)
New Revision: 91283

Modified:
   
trunk/mcs/class/System.Web/System.Web.Compilation/AppSettingsExpressionBuilder.cs
   trunk/mcs/class/System.Web/System.Web.Compilation/ChangeLog
   trunk/mcs/class/System.Web/System.Web.Compilation/TemplateControlCompiler.cs
Log:
2007-12-14  Juraj Skripsky  <[EMAIL PROTECTED]>

        * TemplateControlCompiler.cs (AddExpressionAssign):
        Make sure expression does not contain prefix.
        
        * AppSettingsExpressionBuilder.cs: Pass type of property to
        GetAppSetting, not type of declaring type.



Modified: 
trunk/mcs/class/System.Web/System.Web.Compilation/AppSettingsExpressionBuilder.cs
===================================================================
--- 
trunk/mcs/class/System.Web/System.Web.Compilation/AppSettingsExpressionBuilder.cs
   2007-12-14 13:03:36 UTC (rev 91282)
+++ 
trunk/mcs/class/System.Web/System.Web.Compilation/AppSettingsExpressionBuilder.cs
   2007-12-14 13:47:00 UTC (rev 91283)
@@ -75,7 +75,7 @@
                        PropertyDescriptor descriptor = 
TypeDescriptor.GetProperties(type)[entry.PropertyInfo.Name];
                        CodeExpression[] expressionArray = new 
CodeExpression[3];
                        expressionArray[0] = new 
CodePrimitiveExpression(entry.Expression.Trim());
-                       expressionArray[1] = new CodeTypeOfExpression(type);
+                       expressionArray[1] = new 
CodeTypeOfExpression(entry.Type);
                        expressionArray[2] = new 
CodePrimitiveExpression(entry.Name);
                        return new CodeCastExpression(descriptor.PropertyType, 
new CodeMethodInvokeExpression(new 
                                                                       
CodeTypeReferenceExpression(base.GetType()), "GetAppSetting", expressionArray));

Modified: trunk/mcs/class/System.Web/System.Web.Compilation/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.Compilation/ChangeLog 2007-12-14 
13:03:36 UTC (rev 91282)
+++ trunk/mcs/class/System.Web/System.Web.Compilation/ChangeLog 2007-12-14 
13:47:00 UTC (rev 91283)
@@ -1,3 +1,11 @@
+2007-12-14  Juraj Skripsky  <[EMAIL PROTECTED]>
+
+       * TemplateControlCompiler.cs (AddExpressionAssign):
+       Make sure expression does not contain prefix.
+       
+       * AppSettingsExpressionBuilder.cs: Pass type of property to
+       GetAppSetting, not type of declaring type.
+
 2007-12-13  Marek Habersack  <[EMAIL PROTECTED]>
 
        * TemplateControlCompiler.cs, AspComponentFoundry.cs,

Modified: 
trunk/mcs/class/System.Web/System.Web.Compilation/TemplateControlCompiler.cs
===================================================================
--- 
trunk/mcs/class/System.Web/System.Web.Compilation/TemplateControlCompiler.cs    
    2007-12-14 13:03:36 UTC (rev 91282)
+++ 
trunk/mcs/class/System.Web/System.Web.Compilation/TemplateControlCompiler.cs    
    2007-12-14 13:47:00 UTC (rev 91283)
@@ -670,11 +670,12 @@
                        assign.Left = new CodePropertyReferenceExpression 
(ctrlVar, name);
 
                        // First let's find the correct expression builder
-                       string expr = value.Substring (3, value.Length - 
5).Trim ();
-                       int colon = expr.IndexOf (':');
+                       value = value.Substring (3, value.Length - 5).Trim ();
+                       int colon = value.IndexOf (':');
                        if (colon == -1)
                                return;
-                       string prefix = expr.Substring (0, colon).Trim ();
+                       string prefix = value.Substring (0, colon).Trim ();
+                       string expr = value.Substring (colon + 1).Trim ();
                        
                        System.Configuration.Configuration config = 
WebConfigurationManager.OpenWebConfiguration ("");
                        if (config == null)
@@ -711,7 +712,7 @@
                        try {
                                eb = Activator.CreateInstance (t) as 
System.Web.Compilation.ExpressionBuilder;
                                ctx = new ExpressionBuilderContext 
(HttpContext.Current.Request.FilePath);
-                               parsedData = eb.ParseExpression (expr.Substring 
(colon + 1).Trim (), type, ctx);
+                               parsedData = eb.ParseExpression (expr, type, 
ctx);
                        } catch (Exception e) {
                                throw new HttpException (
                                        String.Format ("Failed to create an 
instance of type `{0}'", builderType), e);

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to