| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- //
- // System.Web.UI.TemplateControlParser
- //
- // Authors:
- // Gonzalo Paniagua Javier ([email protected])
- //
- // (C) 2002 Ximian, Inc (http://www.ximian.com)
- //
- using System;
- using System.Collections;
- using System.IO;
- using System.Web.Compilation;
- namespace System.Web.UI
- {
- public abstract class TemplateControlParser : TemplateParser
- {
- internal object GetCompiledInstance (string virtualPath, string inputFile, HttpContext context)
- {
- InputFile = inputFile;
- Type type = CompileIntoType ();
- if (type == null)
- return null;
- object ctrl = Activator.CreateInstance (type);
- if (ctrl == null)
- return null;
- HandleOptions (ctrl);
- return ctrl;
- }
- protected override void HandleOptions (object obj)
- {
- Control ctrl = obj as Control;
- Hashtable options = Options;
- if (options == null)
- return;
- if (options ["AutoEventWireup"] != null)
- ctrl.AutoEventWireup = (bool) options ["AutoEventWireup"];
- }
- }
- }
|