Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- Int64AnimationUsingKeyFrames.cs
- ExeConfigurationFileMap.cs
- CreationContext.cs
- DataGridViewColumnCollection.cs
- OrderedParallelQuery.cs
- Line.cs
- ComplexType.cs
- RightsManagementEncryptedStream.cs
- PathSegment.cs
- CaseCqlBlock.cs
- FileLogRecordStream.cs
- RangeBaseAutomationPeer.cs
- SafeCoTaskMem.cs
- ClaimComparer.cs
- ValueTable.cs
- ConstraintStruct.cs
- TextDecoration.cs
- GenerateScriptTypeAttribute.cs
- ImageAttributes.cs
- Solver.cs
- FigureHelper.cs
- RawStylusSystemGestureInputReport.cs
- PageEventArgs.cs
- recordstatescratchpad.cs
- ConnectionPool.cs
- sqlstateclientmanager.cs
- WebPartZoneCollection.cs
- SafeArrayRankMismatchException.cs
- TextStore.cs
- NominalTypeEliminator.cs
- DataBinding.cs
- ProfileEventArgs.cs
- MailMessage.cs
- CodeExpressionCollection.cs
- WorkflowInvoker.cs
- SettingsPropertyNotFoundException.cs
- VectorAnimationBase.cs
- LinqDataSource.cs
- OdbcCommand.cs
- DataGridTextBox.cs
- TableStyle.cs
- GlobalEventManager.cs
- DebugHandleTracker.cs
- InvalidAsynchronousStateException.cs
- HasRunnableWorkflowEvent.cs
- TypeUsage.cs
- XmlEntity.cs
- HostVisual.cs
- DataTableMapping.cs
- SeekStoryboard.cs
- SByteConverter.cs
- UniqueSet.cs
- ObjectParameterCollection.cs
- PreviousTrackingServiceAttribute.cs
- IRCollection.cs
- InputScopeAttribute.cs
- _IPv4Address.cs
- GradientBrush.cs
- DotAtomReader.cs
- PagerSettings.cs
- AxisAngleRotation3D.cs
- Image.cs
- _HelperAsyncResults.cs
- SetterTriggerConditionValueConverter.cs
- XDeferredAxisSource.cs
- DataTablePropertyDescriptor.cs
- CodeTypeOfExpression.cs
- WebBrowserDesigner.cs
- PhysicalAddress.cs
- TagPrefixInfo.cs
- WebConfigurationHost.cs
- AttributeData.cs
- GridItemPatternIdentifiers.cs
- SelectionRangeConverter.cs
- Queue.cs
- MenuItem.cs
- StrongName.cs
- BinaryFormatterWriter.cs
- MbpInfo.cs
- ResumeStoryboard.cs
- TimeZone.cs
- CannotUnloadAppDomainException.cs
- TextRangeEditTables.cs
- InvariantComparer.cs
- CategoryAttribute.cs
- EditorPart.cs
- CapabilitiesUse.cs
- ArrayWithOffset.cs
- ExpressionPrefixAttribute.cs
- DetailsView.cs
- GridSplitterAutomationPeer.cs
- BlurEffect.cs
- SMSvcHost.cs
- Latin1Encoding.cs
- HashSet.cs
- SqlDataReader.cs
- DateTimeFormatInfo.cs
- SerializableAttribute.cs
- HMACSHA1.cs
- base64Transforms.cs