Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / UI / WebControls / HotSpot.cs / 1305376 / 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; ////// [ TypeConverter(typeof(ExpandableObjectConverter)) ] public abstract class HotSpot : IStateManager { private bool _isTrackingViewState; private StateBag _viewState; ///Defines abstract class from which all HotSpot shapes must inherit. ////// [ 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 keyboard shortcut key (AccessKey) for setting focus to the /// HotSpot. ////// [ 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 tool tip displayed over the /// hotspot and the text for device-specific display. ////// [ 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 HotSpotMode to either postback or navigation. ////// [ 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 or sets the argument for postback event. ////// protected internal abstract string MarkupName { get; } ///Gets the markup language string representation of the shape name. ////// [ 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 navigation url. ////// [ 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 tab index of the HotSpot. ////// [ 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; } } ///Gets or sets the name of the window for navigation. ////// public abstract string GetCoordinates(); internal void SetDirty() { if (_viewState != null) { _viewState.SetDirty(true); } } public override string ToString () { return GetType().Name; } #region IStatemanager implementation ///Returns a representation of the coordinates according to HTML standards. ////// protected virtual bool IsTrackingViewState { get { return _isTrackingViewState; } } ///Gets a value indicating whether a server control is tracking its view state changes. ////// protected virtual void LoadViewState(object savedState) { if (savedState != null) { ViewState.LoadViewState(savedState); } } ///Restores view-state information that was saved by SaveViewState. ////// protected virtual object SaveViewState() { if (_viewState != null) { return _viewState.SaveViewState(); } return null; } ///Saves any server control view-state changes that have /// occurred since the time the page was posted back to the server. ////// protected virtual void TrackViewState() { _isTrackingViewState = true; if (_viewState != null) { _viewState.TrackViewState(); } } // private implementation of IStateManager ///Causes the tracking of view-state changes to the server control. ///bool IStateManager.IsTrackingViewState { get { return IsTrackingViewState; } } /// void IStateManager.LoadViewState(object savedState) { LoadViewState(savedState); } /// object IStateManager.SaveViewState() { return SaveViewState(); } /// void IStateManager.TrackViewState() { TrackViewState(); } #endregion } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SamlDelegatingWriter.cs
- TransformValueSerializer.cs
- SqlUserDefinedAggregateAttribute.cs
- QueryRewriter.cs
- QilTernary.cs
- ConfigXmlSignificantWhitespace.cs
- Attributes.cs
- RelationshipEndMember.cs
- ProtocolsConfigurationHandler.cs
- TableFieldsEditor.cs
- TextStore.cs
- ProfilePropertySettingsCollection.cs
- _UriTypeConverter.cs
- VBIdentifierTrimConverter.cs
- CodeDomDecompiler.cs
- X509ChainElement.cs
- StatusCommandUI.cs
- HttpProcessUtility.cs
- TableRowGroup.cs
- EnvelopedPkcs7.cs
- assertwrapper.cs
- InkCanvasInnerCanvas.cs
- WebControlAdapter.cs
- GeneralTransform3DCollection.cs
- SecurityDocument.cs
- GlyphsSerializer.cs
- COM2TypeInfoProcessor.cs
- UrlPath.cs
- InheritanceContextChangedEventManager.cs
- EventLogInformation.cs
- Control.cs
- DataGridViewBand.cs
- BlurBitmapEffect.cs
- StrokeNodeEnumerator.cs
- AttachedAnnotation.cs
- PrintControllerWithStatusDialog.cs
- CommandBinding.cs
- EventLogEntryCollection.cs
- DetailsViewPagerRow.cs
- EntitySet.cs
- DesignerDataParameter.cs
- StateRuntime.cs
- UserControlParser.cs
- XPathAncestorIterator.cs
- EventlogProvider.cs
- NamedPipeWorkerProcess.cs
- ProxyWebPartConnectionCollection.cs
- DataExpression.cs
- ErrorTableItemStyle.cs
- GridViewRowEventArgs.cs
- RegexWriter.cs
- FontSource.cs
- CompilerCollection.cs
- KeyTimeConverter.cs
- WebPartChrome.cs
- ZipIOExtraFieldElement.cs
- CaseInsensitiveOrdinalStringComparer.cs
- TCPClient.cs
- DispatcherTimer.cs
- FrugalMap.cs
- EnumValAlphaComparer.cs
- CrossSiteScriptingValidation.cs
- Stacktrace.cs
- XmlILConstructAnalyzer.cs
- ButtonBase.cs
- DependencyPropertyHelper.cs
- IsolationInterop.cs
- _ShellExpression.cs
- COM2PropertyPageUITypeConverter.cs
- Converter.cs
- AVElementHelper.cs
- CultureInfoConverter.cs
- DataControlReferenceCollection.cs
- HttpCookie.cs
- LocalizabilityAttribute.cs
- XmlDataSourceNodeDescriptor.cs
- ListenerSessionConnection.cs
- XmlValidatingReaderImpl.cs
- EmptyControlCollection.cs
- Rect3DValueSerializer.cs
- MenuItemCollectionEditorDialog.cs
- ExtendedPropertyCollection.cs
- ActiveXContainer.cs
- PropertyCondition.cs
- TranslateTransform3D.cs
- Menu.cs
- XsltLibrary.cs
- AtomPub10CategoriesDocumentFormatter.cs
- PreservationFileReader.cs
- CurrencyWrapper.cs
- AssemblyNameEqualityComparer.cs
- DateTimeFormatInfoScanner.cs
- Baml2006ReaderContext.cs
- ScrollEventArgs.cs
- ExtensionWindowResizeGrip.cs
- CompositeCollection.cs
- HeaderPanel.cs
- WebResponse.cs
- CacheDependency.cs
- SafeProcessHandle.cs