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
- FactoryId.cs
- InkPresenter.cs
- SafeThemeHandle.cs
- HttpTransportManager.cs
- CompModSwitches.cs
- WorkerRequest.cs
- Reference.cs
- PairComparer.cs
- ParseNumbers.cs
- Debug.cs
- ChannelFactoryRefCache.cs
- MetadataPropertyAttribute.cs
- PageContentAsyncResult.cs
- WebPartCancelEventArgs.cs
- XPathArrayIterator.cs
- XsdDuration.cs
- CheckPair.cs
- DataObjectEventArgs.cs
- SemanticValue.cs
- BCryptNative.cs
- TextSelectionHelper.cs
- HtmlInputReset.cs
- TemplateControlBuildProvider.cs
- SamlAuthenticationClaimResource.cs
- CompatibleIComparer.cs
- MostlySingletonList.cs
- PermissionToken.cs
- EventMappingSettings.cs
- DataSourceSelectArguments.cs
- SiteMapPathDesigner.cs
- XmlException.cs
- DesignTimeData.cs
- _NestedSingleAsyncResult.cs
- DesignOnlyAttribute.cs
- SynchronizedDispatch.cs
- userdatakeys.cs
- OleDbParameter.cs
- X509ChainPolicy.cs
- DependentTransaction.cs
- UnsafeNativeMethodsPenimc.cs
- EditorPartDesigner.cs
- NonSerializedAttribute.cs
- FrameworkElementAutomationPeer.cs
- DataServiceQuery.cs
- SecurityTraceRecordHelper.cs
- SiteOfOriginPart.cs
- ThrowHelper.cs
- TextElementEnumerator.cs
- XmlSchemaCompilationSettings.cs
- DetailsViewCommandEventArgs.cs
- DefaultConfirmation.cs
- SuppressMessageAttribute.cs
- StylusLogic.cs
- SortableBindingList.cs
- PasswordDeriveBytes.cs
- ConfigXmlElement.cs
- EventRouteFactory.cs
- WebPartCloseVerb.cs
- _LoggingObject.cs
- TimeSpanValidatorAttribute.cs
- TransformerInfo.cs
- DataGridViewAccessibleObject.cs
- Unit.cs
- ControlCollection.cs
- EventData.cs
- LogicalExpressionTypeConverter.cs
- FormConverter.cs
- SplitContainer.cs
- ProcessProtocolHandler.cs
- Sequence.cs
- Point3DIndependentAnimationStorage.cs
- CipherData.cs
- StrokeNode.cs
- OracleSqlParser.cs
- RotateTransform.cs
- ImageMetadata.cs
- PrePostDescendentsWalker.cs
- HttpResponse.cs
- XPathSingletonIterator.cs
- COM2PropertyDescriptor.cs
- SqlFileStream.cs
- ContainerFilterService.cs
- RolePrincipal.cs
- XmlBoundElement.cs
- StandardToolWindows.cs
- SpeechRecognizer.cs
- XmlSubtreeReader.cs
- CorrelationManager.cs
- SqlExpressionNullability.cs
- PeerPresenceInfo.cs
- DPAPIProtectedConfigurationProvider.cs
- KeyToListMap.cs
- ParameterToken.cs
- KnownTypeDataContractResolver.cs
- StandardBindingCollectionElement.cs
- SqlCacheDependencyDatabaseCollection.cs
- DeclaredTypeElement.cs
- MetafileHeader.cs
- MissingMemberException.cs
- _Connection.cs