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
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ContainerUIElement3D.cs
- TextBreakpoint.cs
- MaskedTextBoxTextEditor.cs
- EmptyStringExpandableObjectConverter.cs
- CompareInfo.cs
- DrawingBrush.cs
- Grid.cs
- SqlCommandBuilder.cs
- DataGridViewDataConnection.cs
- DataListItemCollection.cs
- PageBorderless.cs
- ValueSerializerAttribute.cs
- DataGridItem.cs
- MsmqTransportSecurity.cs
- SQLCharsStorage.cs
- IssuedTokenClientBehaviorsElementCollection.cs
- AuthorizationRuleCollection.cs
- DNS.cs
- LocalizedNameDescriptionPair.cs
- SourceElementsCollection.cs
- Conditional.cs
- ProtocolException.cs
- WebPartDisplayModeEventArgs.cs
- CodeTypeMemberCollection.cs
- DataReceivedEventArgs.cs
- _BaseOverlappedAsyncResult.cs
- HistoryEventArgs.cs
- WebMessageFormatHelper.cs
- BitmapVisualManager.cs
- PropertyNames.cs
- DependencyObjectValidator.cs
- DbProviderServices.cs
- UnsafeNativeMethods.cs
- BufferBuilder.cs
- SmuggledIUnknown.cs
- CodeDOMUtility.cs
- Image.cs
- BitmapImage.cs
- HtmlEmptyTagControlBuilder.cs
- XmlSchemaInclude.cs
- GreenMethods.cs
- MimeWriter.cs
- BaseResourcesBuildProvider.cs
- WindowsListBox.cs
- OnOperation.cs
- _NestedMultipleAsyncResult.cs
- IPPacketInformation.cs
- ConfigurationException.cs
- PolicyAssertionCollection.cs
- CategoryGridEntry.cs
- TextParagraphProperties.cs
- TextRunProperties.cs
- GridItem.cs
- EditorZone.cs
- SiteMapNodeItemEventArgs.cs
- LazyTextWriterCreator.cs
- TypeToArgumentTypeConverter.cs
- KeyValuePair.cs
- DataGrid.cs
- XmlSchemaObjectCollection.cs
- KnownTypesProvider.cs
- OpenTypeLayoutCache.cs
- filewebrequest.cs
- ProxyWebPart.cs
- StandardCommands.cs
- HostedTcpTransportManager.cs
- XmlSchemaSet.cs
- ResourceDisplayNameAttribute.cs
- NotifyIcon.cs
- DragStartedEventArgs.cs
- IInstanceContextProvider.cs
- CompositeFontInfo.cs
- InstanceDescriptor.cs
- HttpInputStream.cs
- DetailsViewInsertedEventArgs.cs
- ToolStripOverflow.cs
- MaxValueConverter.cs
- ApplicationSecurityInfo.cs
- ComponentConverter.cs
- ResourceCollectionInfo.cs
- JsonEnumDataContract.cs
- AuthenticationModuleElementCollection.cs
- RootBrowserWindow.cs
- CompilerHelpers.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- NamespaceEmitter.cs
- TemplateField.cs
- BindingListCollectionView.cs
- DataGrid.cs
- SQLInt32.cs
- RepeaterItemCollection.cs
- QilNode.cs
- ClientRuntime.cs
- DbParameterHelper.cs
- RadioButtonStandardAdapter.cs
- AnnotationService.cs
- CalendarModeChangedEventArgs.cs
- HttpHandlersSection.cs
- WebSysDescriptionAttribute.cs
- TraceInternal.cs