mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-16 17:10:20 -10:00
* System.Web.Compilation/AspGenerator.cs: added support for AutoEventWireup attribute in @Page and @Control. * System.Web.Compilation/CompilationResult.cs: * System.Web.Compilation/GlobalAsaxCompiler.cs: * System.Web.Compilation/PageCompiler.cs: * System.Web.Compilation/UserControlCompiler.cs: store the options. * System.Web.UI/Control.cs: added AutoEventWireup internal property. * System.Web.UI/Page.cs: removed page events wire up from here. * System.Web.UI/TemplateControl.cs: new method WireupAutomaticEvents to hook up page and user controls events. * System.Web.UI/TemplateControlParser.cs: process the options that are applicable once we have the instance of the control. * System.Web.UI/TemplateParser.cs: also stores the options. * System.Web.UI/UserControl.cs: hook up events before initializing the control. svn path=/trunk/mcs/; revision=9623
46 lines
952 B
C#
46 lines
952 B
C#
//
|
|
// 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"];
|
|
}
|
|
}
|
|
}
|
|
|