[Mono-dev] TemplateControlCompiler.cs

Chris Toshok toshok at ximian.com
Tue Apr 11 08:31:49 EDT 2006


This looks fine, but please wrap the if/else in #if NET_2_0:

#if NET_2_0
  if (parser.IsPartial)
     typeString = ...
  else
#endif
     typeString = parser.ClassName;

Chris

On Sun, 2006-04-09 at 06:41 -0700, Andrew Skiba wrote:
> Hi, Chris.
> 
> At revision 56619 you introduced the following code at
> TemplateControlCompiler.cs:176
> 
> if (builder is RootBuilder) {
> 	typeString = parser.ClassName;
> }
> 
> In my flow, parser.ClassName == "Default_aspx", which is unresolved, but
> parser.PartialClassName has the correct value of "_Default".
> 
> At BaseCompiler.Init there is a similar code:
> 
> if (parser.IsPartial) {
> 	...
> 	mainClass = new CodeTypeDeclaration (parser.PartialClassName);
> 	...
> } else {
> 	...
> 	mainClass = new CodeTypeDeclaration (parser.ClassName);
> }
> 
> So, what do you think of the following patch? 
> 
> Thank you.
> Andrew.
> 
> Index: TemplateControlCompiler.cs
> ===================================================================
> --- TemplateControlCompiler.cs	(revision 59261)
> +++ TemplateControlCompiler.cs	(working copy)
> @@ -174,7 +174,10 @@
>  			if (childrenAsProperties || builder.ControlType
> == null) {
>  				string typeString;
>  				if (builder is RootBuilder) {
> -					typeString = parser.ClassName;
> +					if (parser.IsPartial)
> +						typeString =
> parser.PartialClassName;
> +					else
> +						typeString =
> parser.ClassName;
>  				}
>  				else {
>  					if (builder.ControlType != null
> && builder.isProperty &&
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list



More information about the Mono-devel-list mailing list