bool ProcessCode (TagType tagtype, string code, ILocation location)
{
PageParserFilter pfilter = PageParserFilter;
// LAMESPEC:
//
// http://msdn.microsoft.com/en-us/library/system.web.ui.pageparserfilter.processcodeconstruct.aspx
//
// The above page says if false is returned then we should NOT process the
// code further, wheras in reality it's the other way around. The
// ProcessCodeConstruct return value means whether or not the filter
// _processed_ the code.
//
if (pfilter != null && (!pfilter.AllowCode || pfilter.ProcessCodeConstruct (MapTagTypeToConstructType (tagtype), code)))
return true;
ControlBuilder b = null;
if (tagtype == TagType.CodeRender)
b = new CodeRenderBuilder (code, false, location);
else if (tagtype == TagType.CodeRenderExpression)
b = new CodeRenderBuilder (code, true, location);
else if (tagtype == TagType.DataBinding)
b = new DataBindingBuilder (code, location);
#if NET_4_0
else if (tagtype == TagType.CodeRenderEncode)
b = new CodeRenderBuilder (code, true, location, true);
#endif
else
throw new HttpException ("Should never happen");
stack.Builder.AppendSubBuilder (b);
return true;
}