Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / ndp / fx / src / xsp / System / Web / UI / WebControls / HotSpotCollection.cs / 1 / HotSpotCollection.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System; using System.Collections; using System.ComponentModel; using System.Drawing.Design; using System.Web.UI; using System.Security.Permissions; namespace System.Web.UI.WebControls { ////// [ Editor("System.Web.UI.Design.WebControls.HotSpotCollectionEditor, " + AssemblyRef.SystemDesign, typeof(UITypeEditor)) ] [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] public sealed class HotSpotCollection : StateManagedCollection { private static readonly Type[] knownTypes = new Type[] { typeof(CircleHotSpot), typeof(RectangleHotSpot), typeof(PolygonHotSpot), }; ///Collection of HotSpots. ////// public HotSpot this[int index] { get { return (HotSpot)((IList)this)[index]; } } ///Returns the HotSpot at a given index. ////// public int Add(HotSpot spot) { return ((IList)this).Add(spot); } ///Adds a HotSpot to the collection. ////// protected override object CreateKnownType(int index) { switch (index) { case 0: return new CircleHotSpot(); case 1: return new RectangleHotSpot(); case 2: return new PolygonHotSpot(); default: throw new ArgumentOutOfRangeException(SR.GetString(SR.HotSpotCollection_InvalidTypeIndex)); } } ///Creates a known type of HotSpot. ////// protected override Type[] GetKnownTypes() { return knownTypes; } ///Returns an ArrayList of known HotSpot types. ////// public void Insert(int index, HotSpot spot) { ((IList)this).Insert(index, spot); } ///Inserts a HotSpot into the collection. ////// protected override void OnValidate(object o) { base.OnValidate(o); if (!(o is HotSpot)) throw new ArgumentException(SR.GetString(SR.HotSpotCollection_InvalidType)); } ///Validates that an object is a HotSpot. ////// public void Remove(HotSpot spot) { ((IList)this).Remove(spot); } ///Removes a HotSpot from the collection. ////// public void RemoveAt(int index) { ((IList)this).RemoveAt(index); } ///Removes a HotSpot from the collection at a given index. ////// protected override void SetDirtyObject(object o) { ((HotSpot)o).SetDirty(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //------------------------------------------------------------------------------ //Marks a HotSpot as dirty so that it will record its entire state into view state. ///// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System; using System.Collections; using System.ComponentModel; using System.Drawing.Design; using System.Web.UI; using System.Security.Permissions; namespace System.Web.UI.WebControls { ////// [ Editor("System.Web.UI.Design.WebControls.HotSpotCollectionEditor, " + AssemblyRef.SystemDesign, typeof(UITypeEditor)) ] [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] public sealed class HotSpotCollection : StateManagedCollection { private static readonly Type[] knownTypes = new Type[] { typeof(CircleHotSpot), typeof(RectangleHotSpot), typeof(PolygonHotSpot), }; ///Collection of HotSpots. ////// public HotSpot this[int index] { get { return (HotSpot)((IList)this)[index]; } } ///Returns the HotSpot at a given index. ////// public int Add(HotSpot spot) { return ((IList)this).Add(spot); } ///Adds a HotSpot to the collection. ////// protected override object CreateKnownType(int index) { switch (index) { case 0: return new CircleHotSpot(); case 1: return new RectangleHotSpot(); case 2: return new PolygonHotSpot(); default: throw new ArgumentOutOfRangeException(SR.GetString(SR.HotSpotCollection_InvalidTypeIndex)); } } ///Creates a known type of HotSpot. ////// protected override Type[] GetKnownTypes() { return knownTypes; } ///Returns an ArrayList of known HotSpot types. ////// public void Insert(int index, HotSpot spot) { ((IList)this).Insert(index, spot); } ///Inserts a HotSpot into the collection. ////// protected override void OnValidate(object o) { base.OnValidate(o); if (!(o is HotSpot)) throw new ArgumentException(SR.GetString(SR.HotSpotCollection_InvalidType)); } ///Validates that an object is a HotSpot. ////// public void Remove(HotSpot spot) { ((IList)this).Remove(spot); } ///Removes a HotSpot from the collection. ////// public void RemoveAt(int index) { ((IList)this).RemoveAt(index); } ///Removes a HotSpot from the collection at a given index. ////// protected override void SetDirtyObject(object o) { ((HotSpot)o).SetDirty(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.Marks a HotSpot as dirty so that it will record its entire state into view state. ///
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ObjectStateEntry.cs
- ArrangedElement.cs
- DataGridCell.cs
- StringCollection.cs
- BindableTemplateBuilder.cs
- EventLogEntry.cs
- ToolStripItemGlyph.cs
- DeferredRunTextReference.cs
- ChannelServices.cs
- SecurityTokenRequirement.cs
- ListBase.cs
- SqlCommand.cs
- DataGridRelationshipRow.cs
- GridProviderWrapper.cs
- FileDetails.cs
- LocationUpdates.cs
- OutputCacheSettings.cs
- TransportationConfigurationTypeInstallComponent.cs
- LinqDataSourceDeleteEventArgs.cs
- SoapUnknownHeader.cs
- ObjectNotFoundException.cs
- StatusBarDrawItemEvent.cs
- XsdCachingReader.cs
- Rotation3DAnimation.cs
- ListBox.cs
- TableItemPattern.cs
- WorkflowViewManager.cs
- Renderer.cs
- ExecutionProperties.cs
- CompositeDuplexElement.cs
- HttpCookie.cs
- Win32.cs
- BulletedList.cs
- LassoHelper.cs
- Point4D.cs
- SoapException.cs
- MetafileHeader.cs
- ObjectStateEntryDbDataRecord.cs
- path.cs
- MinimizableAttributeTypeConverter.cs
- GridViewSelectEventArgs.cs
- CompositeActivityValidator.cs
- ModelTreeEnumerator.cs
- StreamWithDictionary.cs
- DbConnectionInternal.cs
- FormatterServices.cs
- ProxyHwnd.cs
- SqlUserDefinedTypeAttribute.cs
- ListViewHitTestInfo.cs
- NavigationWindowAutomationPeer.cs
- CellParaClient.cs
- RSAOAEPKeyExchangeDeformatter.cs
- ClientCredentialsSecurityTokenManager.cs
- DebugView.cs
- ImageBrush.cs
- RangeValuePattern.cs
- DataBinder.cs
- Span.cs
- DetailsViewInsertEventArgs.cs
- MainMenu.cs
- RtfToXamlReader.cs
- ScriptReference.cs
- PointConverter.cs
- SelectionChangedEventArgs.cs
- Function.cs
- GetCertificateRequest.cs
- SqlBulkCopyColumnMapping.cs
- SettingsPropertyIsReadOnlyException.cs
- WorkflowInlining.cs
- OdbcRowUpdatingEvent.cs
- ListViewInsertionMark.cs
- LinqDataSourceInsertEventArgs.cs
- GestureRecognizer.cs
- ManagementException.cs
- ProgressBar.cs
- Helpers.cs
- ContainerUtilities.cs
- SByteStorage.cs
- SymmetricKeyWrap.cs
- XmlSignificantWhitespace.cs
- WebPartTracker.cs
- EventHandlerList.cs
- CheckBox.cs
- SiteMapPath.cs
- ArcSegment.cs
- BamlLocalizableResource.cs
- SubMenuStyleCollection.cs
- TreeNodeBinding.cs
- TableRowGroup.cs
- EpmAttributeNameBuilder.cs
- ScrollEvent.cs
- Win32SafeHandles.cs
- BitmapEffectInputData.cs
- CodeTypeConstructor.cs
- SQLDecimal.cs
- SystemIcmpV4Statistics.cs
- KeyInstance.cs
- ExecutionEngineException.cs
- SqlReorderer.cs
- EditorBrowsableAttribute.cs