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
- BamlResourceSerializer.cs
- SqlCommandBuilder.cs
- WindowsSolidBrush.cs
- TaiwanLunisolarCalendar.cs
- RevocationPoint.cs
- AssemblyInfo.cs
- MulticastNotSupportedException.cs
- ResumeStoryboard.cs
- Crypto.cs
- OledbConnectionStringbuilder.cs
- DataGridViewCellValidatingEventArgs.cs
- CompilerResults.cs
- GridViewColumnHeader.cs
- PatternMatchRules.cs
- TextEncodedRawTextWriter.cs
- XamlToRtfParser.cs
- ClientFormsAuthenticationCredentials.cs
- XomlDesignerLoader.cs
- SessionState.cs
- ShapingWorkspace.cs
- StringArrayConverter.cs
- StandardOleMarshalObject.cs
- XmlSerializerFactory.cs
- ColorBlend.cs
- EndPoint.cs
- Zone.cs
- GridViewDeletedEventArgs.cs
- MetadataSerializer.cs
- BitmapEffect.cs
- WebPartExportVerb.cs
- CustomAssemblyResolver.cs
- FormParameter.cs
- MsmqHostedTransportManager.cs
- AuthenticatedStream.cs
- StyleCollection.cs
- DocumentSequence.cs
- UnsafeNativeMethods.cs
- TagPrefixCollection.cs
- GenericNameHandler.cs
- DataObject.cs
- SmtpException.cs
- ConversionValidationRule.cs
- FolderBrowserDialog.cs
- TypeBuilderInstantiation.cs
- MetadataItem.cs
- MethodInfo.cs
- ReflectTypeDescriptionProvider.cs
- Gdiplus.cs
- XmlSchemaGroup.cs
- DesigntimeLicenseContextSerializer.cs
- XmlBinaryReader.cs
- IntranetCredentialPolicy.cs
- PeerTransportListenAddressConverter.cs
- SimpleType.cs
- TablePattern.cs
- TypefaceMap.cs
- ProcessInfo.cs
- XmlNamespaceManager.cs
- ZipIOBlockManager.cs
- TextServicesPropertyRanges.cs
- BuilderPropertyEntry.cs
- FieldInfo.cs
- ActivityDefaults.cs
- DataSourceXmlClassAttribute.cs
- SSmlParser.cs
- TreeNodeMouseHoverEvent.cs
- MethodBody.cs
- LookupNode.cs
- WebPartEventArgs.cs
- Random.cs
- InkCanvasSelectionAdorner.cs
- PageStatePersister.cs
- SqlReferenceCollection.cs
- ReferenceConverter.cs
- FixedLineResult.cs
- Choices.cs
- SystemWebExtensionsSectionGroup.cs
- DecoderReplacementFallback.cs
- PolicyStatement.cs
- KeyedHashAlgorithm.cs
- DbMetaDataColumnNames.cs
- ComponentEditorForm.cs
- PathSegmentCollection.cs
- MergablePropertyAttribute.cs
- Vector3DAnimationUsingKeyFrames.cs
- Line.cs
- UnsafeNativeMethods.cs
- XmlSchemaSet.cs
- EntityDataReader.cs
- DataServiceRequestOfT.cs
- TypeListConverter.cs
- Utils.cs
- Msec.cs
- ImageUrlEditor.cs
- ConditionedDesigner.cs
- CodeBlockBuilder.cs
- Int32Rect.cs
- InkSerializer.cs
- FileDetails.cs
- BitmapEffect.cs