// 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;
{
public abstract class ControlAdapter
{
+ internal ControlAdapter (Control c)
+ {
+ control = c;
+ }
+
protected ControlAdapter ()
{
}
- [MonoTODO("Not implemented")]
protected HttpBrowserCapabilities Browser
{
get {
- throw new NotImplementedException ();
+ Page page = Page;
+
+ if (page != null)
+ return page.Request.Browser;
+
+ return null;
}
}
- [MonoTODO("Not implemented")]
+ internal Control control;
+
[Browsable (false)]
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
protected Control Control
{
- get {
- throw new NotImplementedException ();
- }
+ get { return control; }
}
- [MonoTODO("Not implemented")]
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
[Browsable (false)]
protected Page Page
{
get {
- throw new NotImplementedException ();
+ Control control = Control;
+
+ if (control != null)
+ return control.Page;
+
+ return null;
}
}
- [MonoTODO("Not implemented")]
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
[Browsable (false)]
protected PageAdapter PageAdapter
{
get {
- throw new NotImplementedException ();
+ Page page = Page;
+
+ if (page != null)
+ return page.PageAdapter;
+
+ return null;
}
}
- [MonoTODO("Not implemented")]
protected internal virtual void BeginRender (HtmlTextWriter w)
{
- throw new NotImplementedException ();
+ w.BeginRender();
}
- [MonoTODO("Not implemented")]
protected internal virtual void CreateChildControls ()
{
- throw new NotImplementedException ();
+ Control control = Control;
+ if (control != null)
+ control.CreateChildControls ();
}
- [MonoTODO("Not implemented")]
protected internal virtual void EndRender (HtmlTextWriter w)
{
- throw new NotImplementedException ();
+ w.EndRender ();
}
- [MonoTODO("Not implemented")]
protected internal virtual void LoadAdapterControlState (object state)
{
- throw new NotImplementedException ();
}
- [MonoTODO("Not implemented")]
protected internal virtual void LoadAdapterViewState (object state)
{
- throw new NotImplementedException ();
}
- [MonoTODO("Not implemented")]
protected internal virtual void OnInit (EventArgs e)
{
- throw new NotImplementedException ();
+ Control control = Control;
+
+ if (control != null)
+ control.OnInit(e);
}
- [MonoTODO("Not implemented")]
protected internal virtual void OnLoad (EventArgs e)
{
- throw new NotImplementedException ();
+ Control control = Control;
+
+ if (control != null)
+ control.OnLoad(e);
}
- [MonoTODO("Not implemented")]
protected internal virtual void OnPreRender (EventArgs e)
{
- throw new NotImplementedException ();
+ Control control = Control;
+
+ if (control != null)
+ control.OnPreRender(e);
}
- [MonoTODO("Not implemented")]
protected internal virtual void OnUnload (EventArgs e)
{
- throw new NotImplementedException ();
+ Control control = Control;
+
+ if (control != null)
+ control.OnUnload(e);
}
- [MonoTODO("Not implemented")]
protected internal virtual void Render (HtmlTextWriter w)
{
- throw new NotImplementedException ();
+ Control control = Control;
+
+ if (control != null)
+ control.Render (w);
}
- [MonoTODO("Not implemented")]
protected internal virtual void RenderChildren (HtmlTextWriter w)
{
- throw new NotImplementedException ();
+ Control control = Control;
+
+ if (control != null)
+ control.RenderChildren (w);
}
- [MonoTODO("Not implemented")]
protected internal virtual object SaveAdapterControlState ()
{
- throw new NotImplementedException ();
+ return null;
}
- [MonoTODO("Not implemented")]
protected internal virtual object SaveAdapterViewState ()
{
- throw new NotImplementedException ();
+ return null;
}
}
}
-#endif
+