Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- DataPager.cs
- FileRegion.cs
- PackWebRequest.cs
- FastPropertyAccessor.cs
- Operators.cs
- GAC.cs
- TextBoxBase.cs
- DropDownHolder.cs
- Border.cs
- BaseParagraph.cs
- FormsIdentity.cs
- TriggerAction.cs
- SecurityContextTokenCache.cs
- UserControl.cs
- AnnotationComponentChooser.cs
- SqlDataSourceEnumerator.cs
- WorkflowElementDialog.cs
- Substitution.cs
- CustomAttributeFormatException.cs
- graph.cs
- TripleDESCryptoServiceProvider.cs
- Int32AnimationBase.cs
- EntityDataSourceState.cs
- TemplateInstanceAttribute.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- ScrollProperties.cs
- AccessDataSourceView.cs
- CompoundFileReference.cs
- MimeBasePart.cs
- CurrentChangedEventManager.cs
- OptimizerPatterns.cs
- FontDialog.cs
- NegotiationTokenAuthenticatorStateCache.cs
- DataObjectMethodAttribute.cs
- CriticalExceptions.cs
- ItemsPresenter.cs
- PersianCalendar.cs
- BaseResourcesBuildProvider.cs
- wgx_exports.cs
- PointLight.cs
- figurelength.cs
- GroupQuery.cs
- MetadataSource.cs
- FormViewPageEventArgs.cs
- DesignerVerbCollection.cs
- KnownBoxes.cs
- ToolStripItemImageRenderEventArgs.cs
- InstanceView.cs
- SqlConnectionHelper.cs
- OdbcDataReader.cs
- ModelVisual3D.cs
- InfoCard.cs
- BuildTopDownAttribute.cs
- XsdBuilder.cs
- SelectionItemPattern.cs
- ISFTagAndGuidCache.cs
- GregorianCalendarHelper.cs
- WriteFileContext.cs
- FakeModelItemImpl.cs
- XmlIncludeAttribute.cs
- KnownTypesHelper.cs
- OAVariantLib.cs
- UpdateEventArgs.cs
- MessageContractAttribute.cs
- BinaryReader.cs
- StubHelpers.cs
- Events.cs
- ClientBuildManagerTypeDescriptionProviderBridge.cs
- AlgoModule.cs
- PersonalizableAttribute.cs
- NetPipeSectionData.cs
- TrackingLocationCollection.cs
- Quaternion.cs
- WorkflowApplicationTerminatedException.cs
- ProxyHwnd.cs
- PromptBuilder.cs
- DataGridItemCollection.cs
- DataListDesigner.cs
- SrgsOneOf.cs
- KeySpline.cs
- FixedSOMImage.cs
- Package.cs
- SelectionUIService.cs
- TransportBindingElement.cs
- Literal.cs
- TrustManagerMoreInformation.cs
- HtmlContainerControl.cs
- RegexReplacement.cs
- RC2.cs
- GlyphTypeface.cs
- XmlSchemaInclude.cs
- XmlAnyAttributeAttribute.cs
- PrintController.cs
- CodeParameterDeclarationExpression.cs
- BuildProvidersCompiler.cs
- DWriteFactory.cs
- ViewGenResults.cs
- TextTreeText.cs
- Stackframe.cs
- BatchServiceHost.cs