Code:
                         / FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / ndp / fx / src / xsp / System / Web / UI / WebControls / HotSpot.cs / 1 / HotSpot.cs
                        
                        
                            //------------------------------------------------------------------------------ 
// 
//     Copyright (c) Microsoft Corporation.  All rights reserved.
//  
//----------------------------------------------------------------------------- 
namespace System.Web.UI.WebControls {
 
    using System; 
    using System.Collections;
    using System.ComponentModel; 
    using System.Drawing.Design;
    using System.Web.UI;
    using System.Globalization;
    using System.Security.Permissions; 
 
    ///  
    /// Defines abstract class from which all HotSpot shapes must inherit. 
    ///   
    [
    TypeConverter(typeof(ExpandableObjectConverter))
    ]
    [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] 
    [AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)]
    public abstract class HotSpot : IStateManager { 
 
        private bool _isTrackingViewState;
        private StateBag _viewState; 
        /// 
        ///    Gets or sets the keyboard shortcut key (AccessKey) for setting focus to the 
        ///       HotSpot. 
        ///   
        [ 
        DefaultValue(""),
        Localizable(true), 
        WebCategory("Accessibility"),
        WebSysDescription(SR.HotSpot_AccessKey)
        ]
        public virtual string AccessKey { 
            get {
                string s = (string)ViewState["AccessKey"]; 
                if (s != null) { 
                    return s;
                } 
                return String.Empty;
            }
            set {
                // Valid values are null, String.Empty, and single character strings 
                if ((value != null) && (value.Length > 1)) {
                    throw new ArgumentOutOfRangeException("value"); 
                } 
                ViewState["AccessKey"] = value; 
            }
        }
 
        /// 
        /// Gets or sets the tool tip displayed over the 
        /// hotspot and the text for device-specific display.  
        ///  
        [ 
#if ORCAS
        Verification("WCAG", "1.1", VerificationReportLevel.Error, 1, SR.Accessibility_ImageAlternateTextMissing),
        Verification("ADA", "1194.22(a)", VerificationReportLevel.Error, 1, SR.Accessibility_ImageAlternateTextMissing)
#endif 
        Localizable(true),
        Bindable(true), 
        WebCategory("Behavior"), 
        DefaultValue(""),
        WebSysDescription(SR.HotSpot_AlternateText), 
        NotifyParentProperty(true)
        ]
        public virtual String AlternateText {
            get { 
                object text = ViewState["AlternateText"];
                return (text == null)? String.Empty : (string)text; 
            } 
            set {
                ViewState["AlternateText"] = value; 
            }
        }
 
        /// 
        /// Gets or sets the HotSpotMode to either postback or navigation.  
        ///   
        [
        WebCategory("Behavior"), 
        DefaultValue(HotSpotMode.NotSet),
        WebSysDescription(SR.HotSpot_HotSpotMode),
        NotifyParentProperty(true)
        ] 
        public virtual HotSpotMode HotSpotMode {
            get { 
                object obj = ViewState["HotSpotMode"]; 
                return (obj == null) ? HotSpotMode.NotSet : (HotSpotMode)obj;
            } 
            set {
                if (value < HotSpotMode.NotSet || value > HotSpotMode.Inactive) {
                    throw new ArgumentOutOfRangeException("value");
                } 
                ViewState["HotSpotMode"] = value;
            } 
        } 
 
        /// 
        /// Gets or sets the argument for postback event. 
        ///   
        [
        Bindable(true), 
        WebCategory("Behavior"), 
        DefaultValue(""),
        WebSysDescription(SR.HotSpot_PostBackValue), 
        NotifyParentProperty(true)
        ]
        public String PostBackValue {
            get { 
                object value = ViewState["PostBackValue"];
                return (value == null)? String.Empty : (string)value; 
            } 
            set {
                ViewState["PostBackValue"] = value; 
            }
        }
 
        /// 
        /// Gets the markup language string representation of the shape name.  
        ///   
        protected internal abstract string MarkupName {
            get; 
        }
        ///  
        /// Gets or sets the navigation url. 
        ///   
        [ 
        Bindable(true),
        WebCategory("Behavior"), 
        DefaultValue(""),
        WebSysDescription(SR.HotSpot_NavigateUrl),
        NotifyParentProperty(true),
        UrlProperty(), 
        Editor("System.Web.UI.Design.UrlEditor, " + AssemblyRef.SystemDesign, typeof(UITypeEditor)),
        ] 
        public String NavigateUrl { 
            get {
                object value = ViewState["NavigateUrl"]; 
                return (value == null)? String.Empty : (string)value;
            }
            set {
                ViewState["NavigateUrl"] = value; 
            }
        } 
 
        /// 
        ///     
        ///       Gets or
        ///       sets the tab index of the HotSpot. 
        ///  
        [ 
        DefaultValue((short)0),
        WebCategory("Accessibility"), 
        WebSysDescription(SR.HotSpot_TabIndex) 
        ]
        public virtual short TabIndex { 
            get {
                object o = ViewState["TabIndex"];
                if (o != null) {
                     return (short) o; 
                }
                return (short)0; 
            } 
            set {
                ViewState["TabIndex"] = value; 
            }
        }
 
        /// 
        /// Gets or sets the name of the window for navigation.  
        ///   
        [
        WebCategory("Behavior"), 
        DefaultValue(""),
        TypeConverter(typeof(TargetConverter)),
        WebSysDescription(SR.HotSpot_Target),
        NotifyParentProperty(true) 
        ]
        public virtual string Target { 
            get { 
                object value = ViewState["Target"];
                return (value == null)? String.Empty : (string)value; 
            }
            set {
                ViewState["Target"] = value;
            } 
        }
 
 
        [
        Browsable(false), 
        DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)
        ]
        protected StateBag ViewState {
            get { 
                if (_viewState == null) {
                    _viewState = new StateBag(false); 
                    if (_isTrackingViewState) ((IStateManager)_viewState).TrackViewState(); 
                }
                return _viewState; 
            }
        }
 
        /// 
        /// Returns a representation of the coordinates according to HTML standards.  
        ///   
        public abstract string GetCoordinates();
 
        internal void SetDirty() {
            if (_viewState != null) {
                _viewState.SetDirty(true);
            } 
        }
 
 
        public override string ToString () {
            return GetType().Name; 
        }
        #region IStatemanager implementation
 
        /// 
        /// Gets a value indicating whether a server control is tracking its view state changes.  
        ///   
        protected virtual bool IsTrackingViewState {
            get { 
                return _isTrackingViewState;
            }
        }
 
        ///  
        /// Restores view-state information that was saved by SaveViewState.  
        ///  
        protected virtual void LoadViewState(object savedState) { 
            if (savedState != null) {
                ViewState.LoadViewState(savedState);
            }
        } 
 
        ///  
        /// Saves any server control view-state changes that have
        /// occurred since the time the page was posted back to the server.  
        ///  
        protected virtual object SaveViewState() {
            if (_viewState != null) {
                return _viewState.SaveViewState(); 
            }
            return null; 
        } 
        ///  
        /// Causes the tracking of view-state changes to the server control. 
        ///  
        protected virtual void TrackViewState() {
            _isTrackingViewState = true; 
            if (_viewState != null) { 
                _viewState.TrackViewState(); 
            }
        } 
        // private implementation of IStateManager
 
        /// 
//     Copyright (c) Microsoft Corporation.  All rights reserved.
//  
//----------------------------------------------------------------------------- 
namespace System.Web.UI.WebControls {
 
    using System; 
    using System.Collections;
    using System.ComponentModel; 
    using System.Drawing.Design;
    using System.Web.UI;
    using System.Globalization;
    using System.Security.Permissions; 
 
    ///  
    /// Defines abstract class from which all HotSpot shapes must inherit. 
    ///   
    [
    TypeConverter(typeof(ExpandableObjectConverter))
    ]
    [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] 
    [AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)]
    public abstract class HotSpot : IStateManager { 
 
        private bool _isTrackingViewState;
        private StateBag _viewState; 
        /// 
        ///    Gets or sets the keyboard shortcut key (AccessKey) for setting focus to the 
        ///       HotSpot. 
        ///   
        [ 
        DefaultValue(""),
        Localizable(true), 
        WebCategory("Accessibility"),
        WebSysDescription(SR.HotSpot_AccessKey)
        ]
        public virtual string AccessKey { 
            get {
                string s = (string)ViewState["AccessKey"]; 
                if (s != null) { 
                    return s;
                } 
                return String.Empty;
            }
            set {
                // Valid values are null, String.Empty, and single character strings 
                if ((value != null) && (value.Length > 1)) {
                    throw new ArgumentOutOfRangeException("value"); 
                } 
                ViewState["AccessKey"] = value; 
            }
        }
 
        /// 
        /// Gets or sets the tool tip displayed over the 
        /// hotspot and the text for device-specific display.  
        ///  
        [ 
#if ORCAS
        Verification("WCAG", "1.1", VerificationReportLevel.Error, 1, SR.Accessibility_ImageAlternateTextMissing),
        Verification("ADA", "1194.22(a)", VerificationReportLevel.Error, 1, SR.Accessibility_ImageAlternateTextMissing)
#endif 
        Localizable(true),
        Bindable(true), 
        WebCategory("Behavior"), 
        DefaultValue(""),
        WebSysDescription(SR.HotSpot_AlternateText), 
        NotifyParentProperty(true)
        ]
        public virtual String AlternateText {
            get { 
                object text = ViewState["AlternateText"];
                return (text == null)? String.Empty : (string)text; 
            } 
            set {
                ViewState["AlternateText"] = value; 
            }
        }
 
        /// 
        /// Gets or sets the HotSpotMode to either postback or navigation.  
        ///   
        [
        WebCategory("Behavior"), 
        DefaultValue(HotSpotMode.NotSet),
        WebSysDescription(SR.HotSpot_HotSpotMode),
        NotifyParentProperty(true)
        ] 
        public virtual HotSpotMode HotSpotMode {
            get { 
                object obj = ViewState["HotSpotMode"]; 
                return (obj == null) ? HotSpotMode.NotSet : (HotSpotMode)obj;
            } 
            set {
                if (value < HotSpotMode.NotSet || value > HotSpotMode.Inactive) {
                    throw new ArgumentOutOfRangeException("value");
                } 
                ViewState["HotSpotMode"] = value;
            } 
        } 
 
        /// 
        /// Gets or sets the argument for postback event. 
        ///   
        [
        Bindable(true), 
        WebCategory("Behavior"), 
        DefaultValue(""),
        WebSysDescription(SR.HotSpot_PostBackValue), 
        NotifyParentProperty(true)
        ]
        public String PostBackValue {
            get { 
                object value = ViewState["PostBackValue"];
                return (value == null)? String.Empty : (string)value; 
            } 
            set {
                ViewState["PostBackValue"] = value; 
            }
        }
 
        /// 
        /// Gets the markup language string representation of the shape name.  
        ///   
        protected internal abstract string MarkupName {
            get; 
        }
        ///  
        /// Gets or sets the navigation url. 
        ///   
        [ 
        Bindable(true),
        WebCategory("Behavior"), 
        DefaultValue(""),
        WebSysDescription(SR.HotSpot_NavigateUrl),
        NotifyParentProperty(true),
        UrlProperty(), 
        Editor("System.Web.UI.Design.UrlEditor, " + AssemblyRef.SystemDesign, typeof(UITypeEditor)),
        ] 
        public String NavigateUrl { 
            get {
                object value = ViewState["NavigateUrl"]; 
                return (value == null)? String.Empty : (string)value;
            }
            set {
                ViewState["NavigateUrl"] = value; 
            }
        } 
 
        /// 
        ///     
        ///       Gets or
        ///       sets the tab index of the HotSpot. 
        ///  
        [ 
        DefaultValue((short)0),
        WebCategory("Accessibility"), 
        WebSysDescription(SR.HotSpot_TabIndex) 
        ]
        public virtual short TabIndex { 
            get {
                object o = ViewState["TabIndex"];
                if (o != null) {
                     return (short) o; 
                }
                return (short)0; 
            } 
            set {
                ViewState["TabIndex"] = value; 
            }
        }
 
        /// 
        /// Gets or sets the name of the window for navigation.  
        ///   
        [
        WebCategory("Behavior"), 
        DefaultValue(""),
        TypeConverter(typeof(TargetConverter)),
        WebSysDescription(SR.HotSpot_Target),
        NotifyParentProperty(true) 
        ]
        public virtual string Target { 
            get { 
                object value = ViewState["Target"];
                return (value == null)? String.Empty : (string)value; 
            }
            set {
                ViewState["Target"] = value;
            } 
        }
 
 
        [
        Browsable(false), 
        DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)
        ]
        protected StateBag ViewState {
            get { 
                if (_viewState == null) {
                    _viewState = new StateBag(false); 
                    if (_isTrackingViewState) ((IStateManager)_viewState).TrackViewState(); 
                }
                return _viewState; 
            }
        }
 
        /// 
        /// Returns a representation of the coordinates according to HTML standards.  
        ///   
        public abstract string GetCoordinates();
 
        internal void SetDirty() {
            if (_viewState != null) {
                _viewState.SetDirty(true);
            } 
        }
 
 
        public override string ToString () {
            return GetType().Name; 
        }
        #region IStatemanager implementation
 
        /// 
        /// Gets a value indicating whether a server control is tracking its view state changes.  
        ///   
        protected virtual bool IsTrackingViewState {
            get { 
                return _isTrackingViewState;
            }
        }
 
        ///  
        /// Restores view-state information that was saved by SaveViewState.  
        ///  
        protected virtual void LoadViewState(object savedState) { 
            if (savedState != null) {
                ViewState.LoadViewState(savedState);
            }
        } 
 
        ///  
        /// Saves any server control view-state changes that have
        /// occurred since the time the page was posted back to the server.  
        ///  
        protected virtual object SaveViewState() {
            if (_viewState != null) {
                return _viewState.SaveViewState(); 
            }
            return null; 
        } 
        ///  
        /// Causes the tracking of view-state changes to the server control. 
        ///  
        protected virtual void TrackViewState() {
            _isTrackingViewState = true; 
            if (_viewState != null) { 
                _viewState.TrackViewState(); 
            }
        } 
        // private implementation of IStateManager
 
        /// 
                        
                        
                        
                    Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- RuleElement.cs
- SqlCommandBuilder.cs
- CodeDelegateCreateExpression.cs
- MethodBody.cs
- ExponentialEase.cs
- Nullable.cs
- DesignerProperties.cs
- CollectionConverter.cs
- DataGridViewAddColumnDialog.cs
- ViewLoader.cs
- UInt32.cs
- KeyProperty.cs
- InternalBufferManager.cs
- RegistrationProxy.cs
- SharedDp.cs
- SizeFConverter.cs
- DropDownButton.cs
- SafeHandles.cs
- HtmlMeta.cs
- FixedSchema.cs
- FocusManager.cs
- ThemeConfigurationDialog.cs
- SchemaAttDef.cs
- UserControlParser.cs
- GenericTypeParameterBuilder.cs
- ListViewVirtualItemsSelectionRangeChangedEvent.cs
- DesignerDataStoredProcedure.cs
- UInt16Converter.cs
- Int32Rect.cs
- Wizard.cs
- AlternationConverter.cs
- AttachedPropertiesService.cs
- ClusterUtils.cs
- DataGridViewSelectedRowCollection.cs
- Hyperlink.cs
- SqlInternalConnectionSmi.cs
- DefaultTypeArgumentAttribute.cs
- ProfilePropertySettings.cs
- WebPartCatalogCloseVerb.cs
- TextDpi.cs
- HtmlShimManager.cs
- TimeZoneNotFoundException.cs
- PreviewPageInfo.cs
- DelegateInArgument.cs
- DependencyObjectType.cs
- ToolStripPanel.cs
- FileInfo.cs
- MeasureData.cs
- XamlInt32CollectionSerializer.cs
- SimpleFileLog.cs
- NetworkInterface.cs
- SizeChangedInfo.cs
- QilGeneratorEnv.cs
- ComponentSerializationService.cs
- Marshal.cs
- InstanceCreationEditor.cs
- XamlWriter.cs
- ResolveNameEventArgs.cs
- RecognizerStateChangedEventArgs.cs
- BitStream.cs
- RelatedImageListAttribute.cs
- PasswordPropertyTextAttribute.cs
- FixedSOMFixedBlock.cs
- RadioButton.cs
- TrustManagerMoreInformation.cs
- HtmlAnchor.cs
- AccessedThroughPropertyAttribute.cs
- FontFamily.cs
- EndPoint.cs
- DataGridViewBand.cs
- XmlArrayAttribute.cs
- IdleTimeoutMonitor.cs
- ConfigXmlComment.cs
- EventEntry.cs
- wgx_render.cs
- WebControlParameterProxy.cs
- UIHelper.cs
- ParserExtension.cs
- LayoutManager.cs
- XmlSchemaSubstitutionGroup.cs
- SpecialFolderEnumConverter.cs
- ModelPerspective.cs
- NamedPermissionSet.cs
- RoutedEventArgs.cs
- ImagingCache.cs
- ElementsClipboardData.cs
- PropertyHelper.cs
- WebEventTraceProvider.cs
- DynamicActivityXamlReader.cs
- InstanceStore.cs
- TransformationRules.cs
- OdbcConnectionOpen.cs
- HtmlControlPersistable.cs
- WindowsMenu.cs
- ActivitySurrogate.cs
- ConfigurationPropertyCollection.cs
- SqlUnionizer.cs
- Metafile.cs
- TextRunTypographyProperties.cs
- ResourcesGenerator.cs