Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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(); } } }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
- CustomBindingCollectionElement.cs
- Gdiplus.cs
- MappingException.cs
- KnownIds.cs
- DynamicField.cs
- UnsafeNetInfoNativeMethods.cs
- SmtpNetworkElement.cs
- BinaryUtilClasses.cs
- DatagramAdapter.cs
- NullableDecimalAverageAggregationOperator.cs
- CultureSpecificStringDictionary.cs
- ListComponentEditor.cs
- WebAdminConfigurationHelper.cs
- MenuItemBindingCollection.cs
- GridItemCollection.cs
- EventHandlerService.cs
- DetailsViewPageEventArgs.cs
- MasterPage.cs
- XmlBufferReader.cs
- FixedSOMTableRow.cs
- Int64Animation.cs
- DynamicDiscoveryDocument.cs
- InteropBitmapSource.cs
- SqlNotificationEventArgs.cs
- Guid.cs
- ErrorTolerantObjectWriter.cs
- EventLogTraceListener.cs
- ComponentRenameEvent.cs
- DateTimePicker.cs
- MessageQueueAccessControlEntry.cs
- SoapHttpTransportImporter.cs
- DateTimeFormatInfoScanner.cs
- DataAdapter.cs
- X509Certificate.cs
- XamlStyleSerializer.cs
- LinkedDataMemberFieldEditor.cs
- ObjectConverter.cs
- WpfKnownType.cs
- ProfessionalColorTable.cs
- PnrpPermission.cs
- InOutArgumentConverter.cs
- DataServiceRequestOfT.cs
- HttpHandlerAction.cs
- LongValidatorAttribute.cs
- SafeLibraryHandle.cs
- Aggregates.cs
- RecognitionResult.cs
- CroppedBitmap.cs
- ModelItem.cs
- BufferAllocator.cs
- Int32AnimationUsingKeyFrames.cs
- Journal.cs
- CodeThrowExceptionStatement.cs
- FontFamilyValueSerializer.cs
- TabOrder.cs
- DiagnosticsConfigurationHandler.cs
- TemplateBaseAction.cs
- SafeProcessHandle.cs
- DataTableMappingCollection.cs
- EpmSourcePathSegment.cs
- PointCollection.cs
- SevenBitStream.cs
- EventLogQuery.cs
- SevenBitStream.cs
- _SslStream.cs
- webclient.cs
- SuppressMessageAttribute.cs
- ComponentConverter.cs
- ImagingCache.cs
- IsolatedStorageFile.cs
- StylusPointCollection.cs
- ConfigurationManager.cs
- NetPeerTcpBindingElement.cs
- TransactionOptions.cs
- PropertyGridEditorPart.cs
- ListContractAdapter.cs
- XmlWhitespace.cs
- SqlBulkCopy.cs
- BoundField.cs
- TypeBuilder.cs
- SqlCommand.cs
- ObjectIDGenerator.cs
- TextRunCache.cs
- DrawingContextWalker.cs
- WeakReference.cs
- AccessDataSourceView.cs
- Sentence.cs
- SemanticAnalyzer.cs
- RemoteWebConfigurationHostServer.cs
- ExpressionNode.cs
- ProgramPublisher.cs
- ObjectNavigationPropertyMapping.cs
- AutomationTextAttribute.cs
- TreeNodeStyleCollection.cs
- SqlClientWrapperSmiStream.cs
- StopStoryboard.cs
- DataContractSerializerMessageContractImporter.cs
- XmlWellformedWriter.cs
- UDPClient.cs
- Pts.cs