Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / UI / WebControls / HotSpotCollection.cs / 1305376 / 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; namespace System.Web.UI.WebControls { ////// [ Editor("System.Web.UI.Design.WebControls.HotSpotCollectionEditor, " + AssemblyRef.SystemDesign, typeof(UITypeEditor)) ] 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; namespace System.Web.UI.WebControls { ////// [ Editor("System.Web.UI.Design.WebControls.HotSpotCollectionEditor, " + AssemblyRef.SystemDesign, typeof(UITypeEditor)) ] 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

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SrgsElement.cs
- IdentifierCollection.cs
- _SingleItemRequestCache.cs
- ClassicBorderDecorator.cs
- OutputCacheSection.cs
- EmbeddedMailObject.cs
- ScopedKnownTypes.cs
- CompilerError.cs
- StorageEntitySetMapping.cs
- EventLogQuery.cs
- TextModifier.cs
- SafeEventLogReadHandle.cs
- TreeWalkHelper.cs
- JoinQueryOperator.cs
- FixedSOMSemanticBox.cs
- Material.cs
- CollectionConverter.cs
- InstanceHandle.cs
- HasCopySemanticsAttribute.cs
- NumberFunctions.cs
- FtpCachePolicyElement.cs
- DataPagerFieldCommandEventArgs.cs
- DataGridTablesFactory.cs
- XmlNode.cs
- DebugHandleTracker.cs
- FileChangeNotifier.cs
- TableProviderWrapper.cs
- QilTypeChecker.cs
- ConfigurationConverterBase.cs
- ScopelessEnumAttribute.cs
- SerializationObjectManager.cs
- DataSourceSelectArguments.cs
- InternalUserCancelledException.cs
- MemoryMappedViewAccessor.cs
- ReliableSessionBindingElementImporter.cs
- ProfileService.cs
- _SingleItemRequestCache.cs
- HandledMouseEvent.cs
- _SslSessionsCache.cs
- QuotedStringWriteStateInfo.cs
- ExpandSegment.cs
- CompositeTypefaceMetrics.cs
- BaseCodePageEncoding.cs
- DispatchOperationRuntime.cs
- SqlBulkCopyColumnMapping.cs
- XXXInfos.cs
- __ConsoleStream.cs
- MarshalByRefObject.cs
- DetailsViewDeleteEventArgs.cs
- ClrProviderManifest.cs
- Reference.cs
- TypeDescriptor.cs
- ReadOnlyDictionary.cs
- StateBag.cs
- XmlName.cs
- TemporaryBitmapFile.cs
- TypeConverterMarkupExtension.cs
- IImplicitResourceProvider.cs
- SymbolMethod.cs
- QueryContinueDragEvent.cs
- ConnectionConsumerAttribute.cs
- DefaultObjectMappingItemCollection.cs
- SemanticKeyElement.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- DataBoundControlAdapter.cs
- DispatcherProcessingDisabled.cs
- TransformValueSerializer.cs
- HtmlFormParameterReader.cs
- _LocalDataStore.cs
- InteropExecutor.cs
- PrintController.cs
- MutableAssemblyCacheEntry.cs
- PermissionToken.cs
- CompiledQueryCacheKey.cs
- Faults.cs
- UnsafeNativeMethods.cs
- RefreshPropertiesAttribute.cs
- DataServiceContext.cs
- RegistrationServices.cs
- ViewSimplifier.cs
- PersonalizablePropertyEntry.cs
- XsltOutput.cs
- HtmlControlPersistable.cs
- DescendantBaseQuery.cs
- ExtendedProtectionPolicyElement.cs
- ClientBuildManagerCallback.cs
- HtmlInputReset.cs
- ContactManager.cs
- XmlHierarchicalDataSourceView.cs
- EventProxy.cs
- EncoderParameters.cs
- SizeChangedEventArgs.cs
- AddInAttribute.cs
- XamlRtfConverter.cs
- Panel.cs
- FileRecordSequenceCompletedAsyncResult.cs
- ValidationErrorCollection.cs
- Activity.cs
- HierarchicalDataBoundControl.cs
- StrongNameKeyPair.cs