2 // System.Web.UI.PageParserFilter.cs
5 // Arina Itkes (arinai@mainsoft.com)
7 // (C) 2007 Mainsoft Co. (http://www.mainsoft.com)
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32 using System.Collections;
34 namespace System.Web.UI
36 public abstract class PageParserFilter
38 TemplateParser parser;
40 protected PageParserFilter ()
44 public virtual bool AllowCode {
48 [MonoTODO ("Need to implement support for this in the parser")]
50 get { return parser.Location.BeginLine; }
53 public virtual int NumberOfControlsAllowed {
57 public virtual int NumberOfDirectDependenciesAllowed {
61 public virtual int TotalNumberOfDependenciesAllowed {
65 protected string VirtualPath {
66 get { return parser.VirtualPath.Absolute; }
69 protected void AddControl (Type type, IDictionary attributes)
74 parser.AddControl (type, attributes);
77 public virtual bool AllowBaseType (Type baseType)
82 public virtual bool AllowControl (Type controlType, ControlBuilder builder)
87 public virtual bool AllowServerSideInclude (string includeVirtualPath)
92 public virtual bool AllowVirtualReference (string referenceVirtualPath, VirtualReferenceType referenceType)
97 public virtual CompilationMode GetCompilationMode (CompilationMode current)
102 public virtual Type GetNoCompileUserControlType ()
108 // http://msdn.microsoft.com/en-us/library/system.web.ui.pageparserfilter.initialize.aspx
109 // claims there's a virtualPath parameter, but there's none. Probably an internal
110 // method is used to wrap a call to this one.
111 protected virtual void Initialize ()
115 internal void Initialize (TemplateParser parser)
117 this.parser = parser;
121 public virtual void ParseComplete (ControlBuilder rootBuilder)
125 public virtual void PreprocessDirective (string directiveName, IDictionary attributes)
129 public virtual bool ProcessCodeConstruct (CodeConstructType codeType, string code)
134 public virtual bool ProcessDataBindingAttribute (string controlId, string name, string value)
139 public virtual bool ProcessEventHookup (string controlId, string eventName, string handlerName)
144 protected void SetPageProperty (string filter, string name, string value)