// Author:
// Dick Porter <dick@ximian.com>
//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005-2010 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0
using System.Web;
using System.Web.UI;
using System.ComponentModel;
protected HttpBrowserCapabilities Browser
{
get {
- return Page.Request.Browser;
+ Page page = Page;
+
+ if (page != null)
+ return page.Request.Browser;
+
+ return null;
}
}
[Browsable (false)]
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
- protected internal Control Control
+ protected Control Control
{
- protected get {
- return control;
- }
- set {
- control = value;
- }
+ get { return control; }
}
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
protected Page Page
{
get {
- return Control.Page;
+ Control control = Control;
+
+ if (control != null)
+ return control.Page;
+
+ return null;
}
}
protected PageAdapter PageAdapter
{
get {
- return Control.Page.PageAdapter;
+ Page page = Page;
+
+ if (page != null)
+ return page.PageAdapter;
+
+ return null;
}
}
protected internal virtual void CreateChildControls ()
{
+ Control control = Control;
+ if (control != null)
+ control.CreateChildControls ();
}
protected internal virtual void EndRender (HtmlTextWriter w)
protected internal virtual void OnInit (EventArgs e)
{
- Control.OnInit(e);
+ Control control = Control;
+
+ if (control != null)
+ control.OnInit(e);
}
protected internal virtual void OnLoad (EventArgs e)
{
- Control.OnLoad(e);
+ Control control = Control;
+
+ if (control != null)
+ control.OnLoad(e);
}
protected internal virtual void OnPreRender (EventArgs e)
{
- Control.OnPreRender(e);
+ Control control = Control;
+
+ if (control != null)
+ control.OnPreRender(e);
}
protected internal virtual void OnUnload (EventArgs e)
{
- Control.OnUnload(e);
+ Control control = Control;
+
+ if (control != null)
+ control.OnUnload(e);
}
protected internal virtual void Render (HtmlTextWriter w)
{
- Control.Render (w);
+ Control control = Control;
+
+ if (control != null)
+ control.Render (w);
}
protected internal virtual void RenderChildren (HtmlTextWriter w)
{
- Control.RenderChildren (w);
+ Control control = Control;
+
+ if (control != null)
+ control.RenderChildren (w);
}
protected internal virtual object SaveAdapterControlState ()
}
}
}
-#endif
+