* TemplateControlCompiler.cs: make the Bind regex stricter.
When creating Eval expression from Bind, replace single quotes
with double quotes. Fixes bug #447597
When processing Bind expressions and the regex doesn't match,
throw an exception.
2008-11-21 Marek Habersack <[email protected]>
* ControlBuilder.cs: in BindingContainerType if builder is a
RootBuilder and no naming container is found, return typeof
(Page). In the TemplateBuilder case return cb.ControlType, not
this.ControlType.
svn path=/trunk/mcs/; revision=119661
* TemplateControlCompiler.cs: If BindingDirection of the parent
template builder is OneWay in
RegisterBindingInfo, do not throw an exception but simply do not
register the binding.
svn path=/trunk/mcs/; revision=118813
* TemplateControlCompiler.cs: treat Eval and Bind expressions as
verbatim code. The only difference between the two is that in the
latter case Bind is replaced with Eval in the output code. Fixes
bug #444725
2008-11-14 Marek Habersack <[email protected]>
* DataBinder.cs: if Eval doesn't find the indicated property, try
to find an indexer property on the object and use the expression
value as its parameter. Fixes#444725
svn path=/trunk/mcs/; revision=118799
* TemplateControlCompiler.cs: IsWritablePropertyOrField doesn't
use PropertyInfo.CanWrite to check whether the property is
writable anymore, it calls GetSetMethod (false) instead.
svn path=/trunk/mcs/; revision=115941
* TemplateControlCompiler.cs: templates must be instantiated even
for builders which process children as properties.
svn path=/trunk/mcs/; revision=115217
* ControlBuilder.cs: CreatePropertyBuilder now correctly processes
property names with prefixes (e.g. 'prefix:PropertyName').
Original, parsed, tag name is stored to properly handle closing
tags.
2008-09-01 Marek Habersack <[email protected]>
* AspGenerator.cs:
CloseControl uses ControlBuilder's OriginalTagName property,
should the property/tag name be prefixed with 'prefix:'
svn path=/trunk/mcs/; revision=112003
* TemplateControlCompiler.cs:
Templates are processed before anything else, so that children
which may depend on parent's templates can get access to them.
2008-08-31 Marek Habersack <[email protected]>
* Control.cs: improved FillControlCache
* ControlBuilder.cs:
Added a cache for children of TemplateBuilder, used later in
TemplateControlCompiler.
svn path=/trunk/mcs/; revision=111990
* TemplateParser.cs: added support for the LinePragmas directive
attribute.
* ControlBuilder.cs: if this instance is a TemplateBuilder do not
call MyNamingContainer, so that our own ContainerType can be used
as the binding container (if present).
2008-08-31 Marek Habersack <[email protected]>
* TemplateControlCompiler.cs: trust builder.BindingContainerType
in the 2.0+ profile - do not use container properties to detect
the type.
Added a helper method, compiled only when DEBUG is defined, to
generate Console.WriteLine CodeDOM calls.
* BaseCompiler.cs: add line pragmas only if enabled for the
current file.
svn path=/trunk/mcs/; revision=111983
* TemplateControlCompiler.cs: process expression when they are
used used in values of attributes without associated
properties. Fixes bug #417883
* ResourceExpressionBuilder.cs: added two overloads of
CreateGetLocalResourceObject to encompass cases when the generated
expression is not assigned to a property but rather used as a
parameter to the SetAttribute method. Fixes bug #417883
svn path=/trunk/mcs/; revision=110844
* TemplateControlCompiler.cs: .NET allows for whitespace between
the directive start (<%) and the directive type character. Added
code which copes with such situations correctly.
svn path=/trunk/mcs/; revision=110441
* TemplateControlCompiler.cs: rewrote the Bind regular expressions
to allow for single quotes and an optional second parameter to the
"call".
Added an Eval regular expression.
Both Bind and Eval calls in data expressions are now converted
into a CodeDOM method invocations, to allow support for possible
languages which use a different call format (previously code
snippets were used)
Added a method to construct the Eval invoke expression which
simplifies code in other areas.
2008-08-13 Marek Habersack <[email protected]>
* TemplateBuilder.cs: use a generic List to store the bindings on
2.0+
2008-08-13 Marek Habersack <[email protected]>
* HttpException.cs: do not use StringBuilder.AppendFormat when
there is no need.
svn path=/trunk/mcs/; revision=110385
* TemplateControlCompiler.cs: handle situation when a property of
a control for which we're generating the code is of type
'Type'. In such case, variable.GetType() will return
System.MonoType, which must not be output to the generated
source. Thanks to Robert Jordan for giving the idea for the hack!
svn path=/trunk/mcs/; revision=109773
* Calendar.cs: do not create dateInfo in the constructor - culture
might be not set yet at this point. Fixes bug #323566
Added a private property, DateInfo, which creates the dateInfo
when requested.
2008-05-06 Marek Habersack <[email protected]>
* TemplateControlCompiler.cs: compatibility - added the
__stringResource static field to the generated class and a call to
SetStringResourcePointer to the FrameworkInitialize method.
* PageCompiler.cs: __fileDependencies should also be defined in
the 1.x profile.
Page properties assigned in the page directive should be set
inside BuildControlTree in the 2.0 profile.
svn path=/trunk/mcs/; revision=102573
* TemplateControlCompiler.cs: make sure that data-bound attribute
assignments properly convert the Bind expression to the Eval
one. Fixes bug #362039
svn path=/trunk/mcs/; revision=96861
* ControlBuilder.cs: correctly chain up to the parent builder when
looking for the naming container.
2008-02-25 Marek Habersack <[email protected]>
* TemplateControlCompiler.cs: GetContainerType now checks whether
the binding container returned from the builder implements
IDataItemContainer (for 2.0+ profiles) and looks for one more
property, Rows, if no Items property is found.
svn path=/trunk/mcs/; revision=96536
* TemplateControlCompiler.cs: statements to assign
fields/properties from resources must be processed at the very end
of the control creation method. Some controls (like HyperLink) can
set their Text attribute using literal content. In such cases, in
order to properly localize the control, the value read from the
local page resources must be assigned after the literal value has
been added to the control. Fixes bug #323494
svn path=/trunk/mcs/; revision=92458
* TemplateParser.cs: added a wrapper class for server-side script
snippets, to keep track of locations.
Store main directive location for later use in DirectiveLocation
internal property.
2008-01-02 Marek Habersack <[email protected]>
* TemplateControlCompiler.cs: add line pragma wherever necessary.
* PageCompiler.cs: reorder the statements to match MS.NET output.
Output line pragma information for directive attributes.
* BaseCompiler.cs: add a set of AddLinePragma methods for various
CodeDOM elements.
Output line pragmas when adding server-side scripts to the CodeDOM
tree.
* AspGenerator.cs: use ServerSideScript to store script location
in the original file.
* UserControlCompiler.cs: output line pragmas for the init
method.
svn path=/trunk/mcs/; revision=92125
* TemplateControlCompiler.cs (AddExpressionAssign):
Make sure expression does not contain prefix.
* AppSettingsExpressionBuilder.cs: Pass type of property to
GetAppSetting, not type of declaring type.
svn path=/trunk/mcs/; revision=91283
* TemplateControlCompiler.cs, AspComponentFoundry.cs,
AssemblyBuilder.cs, AppResourcesCompiler.cs,
AppResourcesAssemblyBuilder.cs, AppCodeCompiler.cs: speed
optimization - use String.Concat instead of String.Format in some
cases.
2007-12-13 Marek Habersack <[email protected]>
* MailAddress.cs, SmtpClient.cs, MailMessageWrapper.cs: speed
optimization - use String.Concat instead of String.Format in some
cases.
2007-12-13 Marek Habersack <[email protected]>
* HttpRequest.cs, HttpResponse.cs, SiteMapNode.cs, HttpRuntime.cs,
HttpResponseStream.cs, HttpApplication.cs, HttpCachePolicy.cs:
speed optimization - use String.Concat instead of String.Format in
some cases.
2007-12-13 Marek Habersack <[email protected]>
* FileMatchingInfo.cs. MachineKeyRegistryStorage.cs: speed
optimization - use String.Concat instead of String.Format in some
cases.
svn path=/trunk/mcs/; revision=91234
* MinimizableAttributeTypeConverter.cs: don't throw on null value,
call the base class method in that case.
2007-11-03 Marek Habersack <[email protected]>
* TemplateControlCompiler.cs: do not call converters specified in
the member custom attributes if 'str' is null in
GetExpressionFromString.
svn path=/trunk/mcs/; revision=88762
* TemplateControlCompiler.cs, WebServiceCompiler.cs,
BuildProvider.cs, BaseCompiler.cs, CachingCompiler.cs: use
HttpApplication.LoadType instead of Type.GetType.
2007-10-15 Marek Habersack <[email protected]>
* ProvidersHelper.cs: use HttpApplication.LoadType instead of
Type.GetType.
2007-10-15 Marek Habersack <[email protected]>
* ObjectDataSourceView.cs: use HttpApplication.LoadType instead of
Type.GetType.
2007-10-15 Marek Habersack <[email protected]>
* ProfileBase.cs: use HttpApplication.LoadType instead of
Type.GetType.
svn path=/trunk/mcs/; revision=87506
* TemplateControlCompiler.cs: be careful when using type
converters taken from attributes attached to class members. They
may come from the System.Design namespace, which is mostly not
implemented on Mono.
svn path=/trunk/mcs/; revision=87255
* TemplateControlCompiler.cs: if we're running on a platform with
the directory separator character that's different to the Unix
style '/' one, convert the input file path to the virtual path
style string, with path parts separated by '/'. Patch from Robert
Jordan <[email protected]>, thanks! Fixes bug #324229.
svn path=/trunk/mcs/; revision=86118
* LoginView.cs: implemented RoleGroups support. Fixes bug
#324633.
2007-09-20 Marek Habersack <[email protected]>
* TemplateControlCompiler.cs: if a member passed to
GetExpressionFromString has a TypeConverter attribute set, try to
use the named type converter to convert the string value into the
target type. Fixes bug #325489.
svn path=/trunk/mcs/; revision=86092
* TemplateControlCompiler.cs: cast the expression to the field
type whenever appropriate in GetExpressionFromString.
When generating an object instance and one of the parameters is
System.Type, return a typeof expression.
svn path=/trunk/mcs/; revision=85591
* TemplateControlCompiler.cs: another modification to the way
TemplateInstance.Single templates are treated. The search for
parent with this attribute set stops as soon as the first
TemplateBuilder is encountered, no matter what the value of its
TemplateInstance attribute is.
svn path=/trunk/mcs/; revision=85473
* TemplateControlCompiler.cs: Extend the process of checking if a control is located within a
template with the TemplateInstance.Single attribute set, to all
the parents of the current builder.
svn path=/trunk/mcs/; revision=85426
* TemplateControlCompiler.cs: ID must be assigned as soon as
possible, before any other attributes of the control are
accessed. The control code may rely on ID being set.
svn path=/trunk/mcs/; revision=85386
When generating code for a property or field, use the name
retrieved from the metadata by reflection instead of the one
parsed from html. Fixes bug #82687. Patch from SunHo Kim
<[email protected]>, thanks
svn path=/trunk/mcs/; revision=85269
* TemplateControlCompiler.cs: make sure that base class doesn't
contain a field of the same name which is accessible from the
current control if we're within a singleton template.
svn path=/trunk/mcs/; revision=85248
* TemplateBuilder.cs: check for and store for later use the
TemplateContainerAttribute. Added a nullable property
TemplateInstance to return the value of the attribute.
2007-08-29 Marek Habersack <[email protected]>
* TemplateControlCompiler.cs: mark fields corresponding to the
controls as global references.
When control tree is constructed and the parent of the current
builder is a TemplateBuilder marked with the TemplateInstance
attribute set to Single, use the control's ID as the field
name. This makes it possible to refer to controls inside templates
by name instead of by using FindControl.
svn path=/trunk/mcs/; revision=84996
* ControlBuilder.cs: on the 2.0 profile BindingContainerType
returns the associated control's base type when parent builder is
absent instead of typeof (Control). It returns typeof (Control) if
the parent builder type is determined to be a
NamingContainer. This makes the generated code match the MS.NET
output. Fixes bug #82119.
2007-07-18 Marek Habersack <[email protected]>
* TemplateControlCompiler.cs: on the 2.0 profile, GetContainerType
does not look up the Item/Items properties to determine the
container type, instead it just returns the type reported by the
builder passed to this method. This change makes the generated
code match MS.NET. Fixes bug #82119.
svn path=/trunk/mcs/; revision=82200
* TemplateControlCompiler.cs: don't use StartWith to see if a
variable's value is a bind expression, as it erroneously renames
all calls to methods starting with the string Bind. Use a regular
expression now instead. Fixes bug #81928.
svn path=/trunk/mcs/; revision=81172
* TemplateControlCompiler.cs: make sure control has a writable
TemplateControl property prior to assigning values to it.
svn path=/trunk/mcs/; revision=79348
* TemplateControlCompiler.cs: TemplateControl is assigned for
controls that are placed within ContentPlaceHolder and not for the
ContentPlaceHolder itself.
No longer add the overriden version of TemplateSourceDirectory to
the generated source, all the work is now done in
Control.TemplateSourceDirectory.
* BaseCompiler.cs: AppRelativeVirtualPath shouldn't end with a
slash, for compatibility with MS.NET
2007-06-09 Marek Habersack <[email protected]>
* TemplateControl.cs: make sure TemplateControl is set to the
current control.
* Control.cs: TemplateControl property goes up the parent chain if
the property isn't defined in the current control.
TemplateSourceDir finally implemented correctly.
2007-06-09 Marek Habersack <[email protected]>
* ControlTest.cs: enabled two tests that hadn't been working
before.
svn path=/trunk/mcs/; revision=79021
* TemplateControlCompiler.cs: TemplateSourceDirectory in the 2.0
profile uses the TemplateControl property instead of Parent. This
allows to return the correct path.
2007-06-05 Marek Habersack <[email protected]>
* Control.cs: TemplateSourceDirectory uses TemplateControl to
lookup the virtual source directory in the 2.0 instead of the
Parent.
ResolveClientUrl copes with empty TemplateSourceDirectory in the
correct way now - the check is made after the basePath checks.
The changes above make ResolveClientUrl work properly when called
from within a control residing in a TemplateControl.
svn path=/trunk/mcs/; revision=78624
* TemplateControlCompiler.cs: Changed a few incorrect
ObjectCreationExpression to the correct DelegateCreationExpression.
Fixes#81706.
svn path=/trunk/mcs/; revision=77950
* ResourceExpressionBuilder.cs: added a static method to generate
a GetLocalResourceObject call which properly handles types which
cannot be converted from strings.
* TemplateControlCompiler.cs: use code described above to generate
code for properties assigned from resources.
svn path=/trunk/mcs/; revision=77437
* TemplateControlCompiler.cs: BuildTemplateMethod is a delegate,
so use a delegate create expression - it may make difference for
languages other than C# (e.g. VisualBasic).
svn path=/trunk/mcs/; revision=76923
2007-05-04 Marek Habersack <[email protected]>
* HtmlAnchor.cs: use ResolveClientUrl when generating
attributes. Necessary if the control is in a master page which is
in a different directory than the current page.
2007-05-04 Marek Habersack <[email protected]>
* AdRotator.cs: use the new GetPhysicalFilePath method to look up
the physical path of the ad file.
2007-05-04 Marek Habersack <[email protected]>
* TemplateControlCompiler.cs: do not query the parent for
TemplateSourceDirectory if we are generating code for a Master
Page.
2007-05-04 Marek Habersack <[email protected]>
* Control.cs: added an internal method to resolve a physical path
to a file from its virtual path considering the possibility that a
control is placed in a master page, which in turn is referenced
from a directory another than that of master page itself.
svn path=/trunk/mcs/; revision=76665