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
- ToolStripDesignerUtils.cs
- BooleanFunctions.cs
- HandlerBase.cs
- RijndaelManagedTransform.cs
- MsmqInputChannel.cs
- ThemeConfigurationDialog.cs
- WorkflowPersistenceService.cs
- DriveNotFoundException.cs
- BindingListCollectionView.cs
- TypefaceMap.cs
- M3DUtil.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- QueryStringParameter.cs
- ObjectDataSourceView.cs
- CacheEntry.cs
- MimeTypeMapper.cs
- OperationExecutionFault.cs
- HttpConfigurationContext.cs
- NumericUpDownAccelerationCollection.cs
- WorkflowDesigner.cs
- TryExpression.cs
- FrameworkContentElement.cs
- RuntimeConfig.cs
- AccessDataSourceView.cs
- TableRow.cs
- DataServiceHost.cs
- Walker.cs
- ConnectionPointConverter.cs
- ChildrenQuery.cs
- XmlSchemaValidator.cs
- XmlSchemaDatatype.cs
- VariantWrapper.cs
- ExpressionWriter.cs
- TypeBuilder.cs
- LocalizationComments.cs
- XmlSortKeyAccumulator.cs
- ValueQuery.cs
- VisualCollection.cs
- System.Data_BID.cs
- CodeExporter.cs
- Simplifier.cs
- ByteStreamBufferedMessageData.cs
- RectAnimationClockResource.cs
- CryptoApi.cs
- QueryMatcher.cs
- NonSerializedAttribute.cs
- CodeSnippetExpression.cs
- CombinedTcpChannel.cs
- PropertyGridCommands.cs
- XmlEntityReference.cs
- FieldToken.cs
- DataGridViewRowCollection.cs
- SqlDataSourceView.cs
- VirtualPathUtility.cs
- ResourcesGenerator.cs
- Utility.cs
- COAUTHIDENTITY.cs
- Shape.cs
- RegexCapture.cs
- Span.cs
- SamlConditions.cs
- MessageVersionConverter.cs
- Inflater.cs
- UdpChannelFactory.cs
- RegistrySecurity.cs
- ScriptManagerProxy.cs
- GPPOINTF.cs
- CultureTableRecord.cs
- HttpVersion.cs
- TextViewSelectionProcessor.cs
- HandleValueEditor.cs
- CompiledXpathExpr.cs
- VirtualizingStackPanel.cs
- ContextStack.cs
- VersionedStream.cs
- RuleConditionDialog.cs
- FormViewPagerRow.cs
- CodeDelegateInvokeExpression.cs
- WebBrowserNavigatingEventHandler.cs
- PerfCounters.cs
- NamedPermissionSet.cs
- DataGridView.cs
- BindingOperations.cs
- RelationshipNavigation.cs
- HttpCachePolicyElement.cs
- TdsEnums.cs
- PerformanceCountersElement.cs
- Application.cs
- SmtpReplyReader.cs
- DataListItemCollection.cs
- Floater.cs
- X509ChainPolicy.cs
- TypeLibConverter.cs
- BaseCollection.cs
- ToolTip.cs
- CacheChildrenQuery.cs
- DataGridDesigner.cs
- CompilerScope.cs
- AvTraceDetails.cs
- XmlSchemaComplexContentRestriction.cs