Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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. //------------------------------------------------------------------------------ //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.Marks a HotSpot as dirty so that it will record its entire state into view state. ///
Link Menu
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- AppDomainUnloadedException.cs
- FixedSchema.cs
- UpDownEvent.cs
- PasswordTextContainer.cs
- TraceUtility.cs
- Update.cs
- PlatformCulture.cs
- GeneralTransform3DTo2DTo3D.cs
- ControlCollection.cs
- SortQuery.cs
- DataPointer.cs
- DayRenderEvent.cs
- NativeMethods.cs
- MouseActionConverter.cs
- ByteStack.cs
- DesigntimeLicenseContextSerializer.cs
- mongolianshape.cs
- SeekStoryboard.cs
- PropertyChangeTracker.cs
- AppDomainFactory.cs
- TextOnlyOutput.cs
- TextTreeTextElementNode.cs
- NaturalLanguageHyphenator.cs
- ScrollBar.cs
- CompoundFileDeflateTransform.cs
- TimeSpanValidatorAttribute.cs
- QueryOutputWriter.cs
- SafeNativeMethodsCLR.cs
- TagPrefixCollection.cs
- TypeSystem.cs
- DeleteMemberBinder.cs
- FrameSecurityDescriptor.cs
- BufferedStream.cs
- ExpressionNode.cs
- ObjectListSelectEventArgs.cs
- CacheDependency.cs
- LabelLiteral.cs
- XmlWriter.cs
- SQLStringStorage.cs
- InkCollectionBehavior.cs
- DataFormat.cs
- BehaviorService.cs
- MetadataCacheItem.cs
- ListViewGroupItemCollection.cs
- Point3DIndependentAnimationStorage.cs
- SiteMapHierarchicalDataSourceView.cs
- WindowsSysHeader.cs
- CommandEventArgs.cs
- XmlDeclaration.cs
- MemoryRecordBuffer.cs
- WsiProfilesElement.cs
- ConcurrentBag.cs
- WorkflowOwnershipException.cs
- Model3DCollection.cs
- PrinterResolution.cs
- SplayTreeNode.cs
- HMACSHA256.cs
- OperatingSystem.cs
- IssuedSecurityTokenProvider.cs
- AttributeQuery.cs
- XmlSchemaGroup.cs
- JsonStringDataContract.cs
- XmlSchemaSimpleTypeList.cs
- DocumentSchemaValidator.cs
- XmlBindingWorker.cs
- LexicalChunk.cs
- SchemaEntity.cs
- Part.cs
- CriticalHandle.cs
- RedBlackList.cs
- XmlStreamStore.cs
- HostedBindingBehavior.cs
- ProjectionCamera.cs
- StringExpressionSet.cs
- SHA1.cs
- SystemColors.cs
- ValidationResults.cs
- pingexception.cs
- PriorityQueue.cs
- ReadOnlyNameValueCollection.cs
- TransformerInfo.cs
- SqlBinder.cs
- ExceptionUtil.cs
- DoubleLinkList.cs
- SmtpClient.cs
- SqlDependencyListener.cs
- HandlerMappingMemo.cs
- RequestChannelBinder.cs
- TraceSection.cs
- FloaterBaseParaClient.cs
- PopOutPanel.cs
- Thread.cs
- hresults.cs
- ResourceContainer.cs
- StringComparer.cs
- UIElementHelper.cs
- ResourcePart.cs
- XmlnsDictionary.cs
- Thread.cs
- PersonalizationAdministration.cs