Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / 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 {
///
/// Collection of HotSpots.
///
[
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),
};
///
/// Returns the HotSpot at a given index.
///
public HotSpot this[int index] {
get {
return (HotSpot)((IList)this)[index];
}
}
///
/// Adds a HotSpot to the collection.
///
public int Add(HotSpot spot) {
return ((IList)this).Add(spot);
}
///
/// Creates a known type of HotSpot.
///
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));
}
}
///
/// Returns an ArrayList of known HotSpot types.
///
protected override Type[] GetKnownTypes() {
return knownTypes;
}
///
/// Inserts a HotSpot into the collection.
///
public void Insert(int index, HotSpot spot) {
((IList)this).Insert(index, spot);
}
///
/// Validates that an object is a HotSpot.
///
protected override void OnValidate(object o) {
base.OnValidate(o);
if (!(o is HotSpot))
throw new ArgumentException(SR.GetString(SR.HotSpotCollection_InvalidType));
}
///
/// Removes a HotSpot from the collection.
///
public void Remove(HotSpot spot) {
((IList)this).Remove(spot);
}
///
/// Removes a HotSpot from the collection at a given index.
///
public void RemoveAt(int index) {
((IList)this).RemoveAt(index);
}
///
/// Marks a HotSpot as dirty so that it will record its entire state into view state.
///
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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XhtmlBasicCalendarAdapter.cs
- QuadraticBezierSegment.cs
- SiteMapDataSource.cs
- SvcMapFileSerializer.cs
- Quaternion.cs
- SecurityChannelFaultConverter.cs
- SimpleHandlerFactory.cs
- MultilineStringEditor.cs
- PropertyNames.cs
- LabelEditEvent.cs
- PageContentCollection.cs
- AdobeCFFWrapper.cs
- EntitySqlQueryState.cs
- SessionStateSection.cs
- TraceUtils.cs
- XsdDateTime.cs
- EdmMember.cs
- FormViewInsertEventArgs.cs
- SoapSchemaImporter.cs
- UMPAttributes.cs
- ContentValidator.cs
- BlurEffect.cs
- SimpleLine.cs
- TablePatternIdentifiers.cs
- FormViewDeletedEventArgs.cs
- DesignTimeDataBinding.cs
- Binding.cs
- UdpSocket.cs
- ApplicationProxyInternal.cs
- ItemsChangedEventArgs.cs
- ConstNode.cs
- QuotedStringWriteStateInfo.cs
- HoistedLocals.cs
- FormsIdentity.cs
- PageWrapper.cs
- TextContainerHelper.cs
- LinearKeyFrames.cs
- CodeCatchClause.cs
- DragEventArgs.cs
- AxHost.cs
- WebConfigurationHost.cs
- SchemaType.cs
- InputReferenceExpression.cs
- ComplexBindingPropertiesAttribute.cs
- RecognizerBase.cs
- ObjectStorage.cs
- SrgsSubset.cs
- Compiler.cs
- TemplateBindingExpression.cs
- AutomationProperties.cs
- BatchWriter.cs
- ScriptResourceInfo.cs
- TypeGeneratedEventArgs.cs
- CompilationSection.cs
- InkCanvasFeedbackAdorner.cs
- WebPartExportVerb.cs
- XmlSerializerNamespaces.cs
- ValueSerializer.cs
- FileDialogCustomPlaces.cs
- CodeObjectCreateExpression.cs
- SQLUtility.cs
- ContentAlignmentEditor.cs
- ObjectConverter.cs
- DebugInfo.cs
- SamlSecurityToken.cs
- ProfileBuildProvider.cs
- ListViewTableRow.cs
- UInt32Storage.cs
- FormCollection.cs
- DbConnectionInternal.cs
- designeractionlistschangedeventargs.cs
- ProfileBuildProvider.cs
- CurrencyWrapper.cs
- TcpDuplicateContext.cs
- PopupEventArgs.cs
- VarRemapper.cs
- SymLanguageType.cs
- XsdSchemaFileEditor.cs
- PngBitmapEncoder.cs
- SqlDataSourceView.cs
- TextSelectionHelper.cs
- LinqDataSource.cs
- SplineQuaternionKeyFrame.cs
- CommandField.cs
- ClientApiGenerator.cs
- CodeArrayCreateExpression.cs
- SecurityIdentifierElement.cs
- TypeToStringValueConverter.cs
- CodeRegionDirective.cs
- SimpleFieldTemplateUserControl.cs
- MimeTypeMapper.cs
- Native.cs
- Int32Storage.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- columnmapfactory.cs
- ExtenderHelpers.cs
- MetadataCache.cs
- WindowsGraphicsWrapper.cs
- ToolStripDropDown.cs
- Decoder.cs