D:/Projects/Anthem/Anthem/MultiView.cs

00001 #if V2
00002 
00003 using System;
00004 using System.ComponentModel;
00005 using System.Drawing;
00006 using System.Web.UI;
00007 using ASP = System.Web.UI.WebControls;
00008 
00009 namespace Anthem
00010 {
00014     [ToolboxBitmap(typeof(ASP.MultiView))]
00015     public class MultiView : ASP.MultiView, IUpdatableControl
00016     {
00017         #region Unique Anthem control code
00018 
00023         protected override void OnActiveViewChanged(EventArgs e)
00024         {
00025             base.OnActiveViewChanged(e);
00026             UpdateAfterCallBack = true;
00027         }
00028 
00029         private const string parentTagName = "div";
00034         protected override void Render(HtmlTextWriter writer)
00035         {
00036 #if !V2
00037             bool DesignMode = this.Context == null;
00038 #endif
00039             if (!DesignMode)
00040             {
00041                 Anthem.Manager.WriteBeginControlMarker(writer, parentTagName, this);
00042             }
00043             if (Visible)
00044             {
00045                 base.Render(writer);
00046             }
00047             if (!DesignMode)
00048             {
00049                 Anthem.Manager.WriteEndControlMarker(writer, parentTagName, this);
00050             }
00051         }
00052 
00053         #endregion
00054 
00055         #region IUpdatableControl implementation
00056 
00070         [Category("Anthem")]
00071         [DefaultValue(false)]
00072         [Description("True if this control should be updated after each callback.")]
00073         public virtual bool AutoUpdateAfterCallBack
00074         {
00075             get
00076             {
00077                 object obj = this.ViewState["AutoUpdateAfterCallBack"];
00078                 if (obj == null)
00079                     return false;
00080                 else
00081                     return (bool)obj;
00082             }
00083             set
00084             {
00085                 if (value) UpdateAfterCallBack = true;
00086                 ViewState["AutoUpdateAfterCallBack"] = value;
00087             }
00088         }
00089 
00090         private bool _updateAfterCallBack = false;
00091 
00106         [Browsable(false)]
00107         [DefaultValue(false)]
00108         public virtual bool UpdateAfterCallBack
00109         {
00110             get { return _updateAfterCallBack; }
00111             set { _updateAfterCallBack = value; }
00112         }
00113 
00114         #endregion
00115 
00116         #region Common Anthem control code
00117 
00123         protected override void OnLoad(EventArgs e)
00124         {
00125             base.OnLoad(e);
00126             Anthem.Manager.Register(this);
00127         }
00128 
00129 #if V2
00133         public override void RenderControl(HtmlTextWriter writer)
00134         {
00135             base.Visible = true;
00136             base.RenderControl(writer);
00137         }
00138 #endif
00139 
00147         public override bool Visible
00148         {
00149             get
00150             {
00151 #if !V2
00152                 bool DesignMode = this.Context == null;
00153 #endif
00154                 return Anthem.Manager.GetControlVisible(this, ViewState, DesignMode);
00155             }
00156             set { Anthem.Manager.SetControlVisible(ViewState, value); }
00157         }
00158 
00159         #endregion
00160     }
00161 }
00162 
00163 #endif

Generated on Wed Mar 14 23:50:39 2007 for Anthem by  doxygen 1.5.1-p1