Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / xsp / System / Web / UI / WebParts / ConsumerConnectionPointCollection.cs / 1 / ConsumerConnectionPointCollection.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.WebControls.WebParts { using System.Collections; using System.Collections.Specialized; using System.Globalization; using System.Security.Permissions; [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] public sealed class ConsumerConnectionPointCollection : ReadOnlyCollectionBase { private HybridDictionary _ids; public ConsumerConnectionPointCollection() { } public ConsumerConnectionPointCollection(ICollection connectionPoints) { if (connectionPoints == null) { throw new ArgumentNullException("connectionPoints"); } _ids = new HybridDictionary(connectionPoints.Count, true /* caseInsensitive */); foreach (object obj in connectionPoints) { if (obj == null) { throw new ArgumentException(SR.GetString(SR.Collection_CantAddNull), "connectionPoints"); } ConsumerConnectionPoint point = obj as ConsumerConnectionPoint; if (point == null) { throw new ArgumentException(SR.GetString(SR.Collection_InvalidType, "ConsumerConnectionPoint"), "connectionPoints"); } string id = point.ID; if (!_ids.Contains(id)) { InnerList.Add(point); _ids.Add(id, point); } else { throw new ArgumentException(SR.GetString( SR.WebPart_Collection_DuplicateID, "ConsumerConnectionPoint", id), "connectionPoints"); } } } public ConsumerConnectionPoint Default { get { return this[ConnectionPoint.DefaultID]; } } public ConsumerConnectionPoint this[int index] { get { return (ConsumerConnectionPoint)InnerList[index]; } } public ConsumerConnectionPoint this[string id] { get { return ((_ids != null) ? (ConsumerConnectionPoint)_ids[id] : null); } } public bool Contains(ConsumerConnectionPoint connectionPoint) { return InnerList.Contains(connectionPoint); } public int IndexOf(ConsumerConnectionPoint connectionPoint) { return InnerList.IndexOf(connectionPoint); } public void CopyTo(ConsumerConnectionPoint[] array, int index) { InnerList.CopyTo(array, index); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.WebControls.WebParts { using System.Collections; using System.Collections.Specialized; using System.Globalization; using System.Security.Permissions; [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] public sealed class ConsumerConnectionPointCollection : ReadOnlyCollectionBase { private HybridDictionary _ids; public ConsumerConnectionPointCollection() { } public ConsumerConnectionPointCollection(ICollection connectionPoints) { if (connectionPoints == null) { throw new ArgumentNullException("connectionPoints"); } _ids = new HybridDictionary(connectionPoints.Count, true /* caseInsensitive */); foreach (object obj in connectionPoints) { if (obj == null) { throw new ArgumentException(SR.GetString(SR.Collection_CantAddNull), "connectionPoints"); } ConsumerConnectionPoint point = obj as ConsumerConnectionPoint; if (point == null) { throw new ArgumentException(SR.GetString(SR.Collection_InvalidType, "ConsumerConnectionPoint"), "connectionPoints"); } string id = point.ID; if (!_ids.Contains(id)) { InnerList.Add(point); _ids.Add(id, point); } else { throw new ArgumentException(SR.GetString( SR.WebPart_Collection_DuplicateID, "ConsumerConnectionPoint", id), "connectionPoints"); } } } public ConsumerConnectionPoint Default { get { return this[ConnectionPoint.DefaultID]; } } public ConsumerConnectionPoint this[int index] { get { return (ConsumerConnectionPoint)InnerList[index]; } } public ConsumerConnectionPoint this[string id] { get { return ((_ids != null) ? (ConsumerConnectionPoint)_ids[id] : null); } } public bool Contains(ConsumerConnectionPoint connectionPoint) { return InnerList.Contains(connectionPoint); } public int IndexOf(ConsumerConnectionPoint connectionPoint) { return InnerList.IndexOf(connectionPoint); } public void CopyTo(ConsumerConnectionPoint[] array, int index) { InnerList.CopyTo(array, index); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SqlDataSourceConfigureSelectPanel.cs
- SqlNodeTypeOperators.cs
- PackagePartCollection.cs
- QilNode.cs
- ProgressBar.cs
- RoleProviderPrincipal.cs
- SafeArrayRankMismatchException.cs
- SqlClientFactory.cs
- PointCollection.cs
- RadialGradientBrush.cs
- WorkflowClientDeliverMessageWrapper.cs
- Unit.cs
- HwndAppCommandInputProvider.cs
- ApplicationSettingsBase.cs
- DefaultProxySection.cs
- _BaseOverlappedAsyncResult.cs
- DataGridViewRowCancelEventArgs.cs
- GB18030Encoding.cs
- XmlAnyElementAttributes.cs
- EntityRecordInfo.cs
- LocatorPartList.cs
- CompModSwitches.cs
- MaskInputRejectedEventArgs.cs
- TransformerTypeCollection.cs
- VersionedStreamOwner.cs
- DiagnosticSection.cs
- CollectionDataContract.cs
- DataAdapter.cs
- CultureTable.cs
- MainMenu.cs
- ResourcePool.cs
- FontStretches.cs
- SQLSingleStorage.cs
- SystemResources.cs
- MemberRelationshipService.cs
- MenuItemCollection.cs
- PointCollection.cs
- ResolveNameEventArgs.cs
- DiscoveryMessageSequence.cs
- ConfigurationManagerInternal.cs
- EnumBuilder.cs
- DataGridColumnCollection.cs
- TypeDelegator.cs
- _RequestCacheProtocol.cs
- BindingElementCollection.cs
- WebControlToolBoxItem.cs
- SystemKeyConverter.cs
- ReturnType.cs
- WebServiceResponseDesigner.cs
- TreeIterator.cs
- CompilerParameters.cs
- _SslSessionsCache.cs
- ListBindableAttribute.cs
- AudienceUriMode.cs
- ToolStripDropDown.cs
- EngineSiteSapi.cs
- WebPartUserCapability.cs
- InkCanvasInnerCanvas.cs
- TripleDESCryptoServiceProvider.cs
- HierarchicalDataSourceIDConverter.cs
- ToolStripButton.cs
- XmlDomTextWriter.cs
- ModuleConfigurationInfo.cs
- ImageMetadata.cs
- IndexedGlyphRun.cs
- RtfToken.cs
- _SSPISessionCache.cs
- SchemaImporter.cs
- sortedlist.cs
- RenamedEventArgs.cs
- HtmlInputPassword.cs
- X509ScopedServiceCertificateElement.cs
- EditingCoordinator.cs
- IndexedString.cs
- WSSecurityOneDotOneSendSecurityHeader.cs
- PtsHelper.cs
- SoapAttributes.cs
- CatalogUtil.cs
- ProcessHostServerConfig.cs
- PointCollectionConverter.cs
- DomainConstraint.cs
- ContentValidator.cs
- Splitter.cs
- BamlTreeMap.cs
- TextLineResult.cs
- ModelFactory.cs
- GraphicsPathIterator.cs
- BindStream.cs
- AnnotationStore.cs
- AppSettingsExpressionBuilder.cs
- EmptyStringExpandableObjectConverter.cs
- CodeSubDirectoriesCollection.cs
- PropertySourceInfo.cs
- ButtonBaseAdapter.cs
- OdbcParameter.cs
- SecurityTokenAuthenticator.cs
- RelatedPropertyManager.cs
- StringStorage.cs
- SqlServices.cs
- PartManifestEntry.cs