| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202 |
- //
- // System.Web.UI.WebControls.HotSpot.cs
- //
- // Authors:
- // Lluis Sanchez Gual ([email protected])
- //
- // (C) 2005 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
- // "Software"), to deal in the Software without restriction, including
- // without limitation the rights to use, copy, modify, merge, publish,
- // distribute, sublicense, and/or sell copies of the Software, and to
- // permit persons to whom the Software is furnished to do so, subject to
- // the following conditions:
- //
- // The above copyright notice and this permission notice shall be
- // included in all copies or substantial portions of the Software.
- //
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- //
- #if NET_2_0
- using System.ComponentModel;
- using System.Security.Permissions;
- namespace System.Web.UI.WebControls
- {
- [TypeConverterAttribute (typeof(ExpandableObjectConverter))]
- [AspNetHostingPermissionAttribute (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- [AspNetHostingPermissionAttribute (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- public abstract class HotSpot: IStateManager
- {
- StateBag viewState = new StateBag ();
-
- [LocalizableAttribute (true)]
- [DefaultValueAttribute ("")]
- public virtual string AccessKey {
- get {
- object o = viewState ["AccessKey"];
- return o != null ? (string) o : "";
- }
- set {
- viewState ["AccessKey"] = value;
- }
- }
-
- [LocalizableAttribute (true)]
- [NotifyParentPropertyAttribute (true)]
- [WebCategoryAttribute ("Behavior")]
- [DefaultValueAttribute ("")]
- [BindableAttribute (true)]
- public virtual string AlternateText {
- get {
- object o = viewState ["AlternateText"];
- return o != null ? (string) o : "";
- }
- set {
- viewState ["AlternateText"] = value;
- }
- }
-
- [WebCategoryAttribute ("Behavior")]
- [DefaultValueAttribute (HotSpotMode.NotSet)]
- [NotifyParentPropertyAttribute (true)]
- public virtual HotSpotMode HotSpotMode {
- get {
- object o = viewState ["HotSpotMode"];
- return o != null ? (HotSpotMode) o : HotSpotMode.NotSet;
- }
- set {
- viewState ["HotSpotMode"] = value;
- }
- }
-
- [DefaultValueAttribute ("")]
- [BindableAttribute (true)]
- [EditorAttribute ("System.Web.UI.Design.UrlEditor, " + Consts.AssemblySystem_Design, "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing)]
- [NotifyParentPropertyAttribute (true)]
- [UrlPropertyAttribute]
- public string NavigateUrl {
- get {
- object o = viewState ["NavigateUrl"];
- return o != null ? (string) o : "";
- }
- set {
- viewState ["NavigateUrl"] = value;
- }
- }
-
- [BindableAttribute (true)]
- [WebCategoryAttribute ("Behavior")]
- [DefaultValueAttribute ("")]
- [NotifyParentPropertyAttribute (true)]
- public string PostBackValue {
- get {
- object o = viewState ["PostBackValue"];
- return o != null ? (string) o : "";
- }
- set {
- viewState ["PostBackValue"] = value;
- }
- }
-
- [DefaultValueAttribute ((short)0)]
- [WebCategoryAttribute ("Accessibility")]
- public virtual short TabIndex {
- get {
- object o = viewState ["TabIndex"];
- return o != null ? (short) o : (short) 0;
- }
- set {
- viewState ["TabIndex"] = value;
- }
- }
-
- [WebCategoryAttribute ("Behavior")]
- [NotifyParentPropertyAttribute (true)]
- [DefaultValueAttribute ("")]
- [TypeConverterAttribute (typeof(TargetConverter))]
- public virtual string Target {
- get {
- object o = viewState ["Target"];
- return o != null ? (string) o : "";
- }
- set {
- viewState ["Target"] = value;
- }
- }
-
- [Browsable (false)]
- [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
- protected StateBag ViewState {
- get { return viewState; }
- }
-
- protected virtual void LoadViewState (object savedState)
- {
- viewState.LoadViewState (savedState);
- }
-
- protected virtual object SaveViewState ()
- {
- return viewState.SaveViewState ();
- }
-
- protected virtual void TrackViewState ()
- {
- viewState.TrackViewState ();
- }
-
- protected virtual bool IsTrackingViewState
- {
- get { return viewState.IsTrackingViewState; }
- }
-
- void IStateManager.LoadViewState (object savedState)
- {
- LoadViewState (savedState);
- }
-
- object IStateManager.SaveViewState ()
- {
- return SaveViewState ();
- }
-
- void IStateManager.TrackViewState ()
- {
- TrackViewState ();
- }
-
- bool IStateManager.IsTrackingViewState
- {
- get { return IsTrackingViewState; }
- }
-
- public override string ToString ()
- {
- return GetType().Name;
- }
-
- internal void SetDirty ()
- {
- viewState.SetDirty (true);
- }
-
- public abstract string GetCoordinates ();
-
- protected internal abstract string MarkupName { get; }
- }
- }
- #endif
|