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
- EpmCustomContentWriterNodeData.cs
- ObjectResult.cs
- LinearGradientBrush.cs
- HttpAsyncResult.cs
- ToolTipService.cs
- SettingsPropertyWrongTypeException.cs
- WebCodeGenerator.cs
- SplitterCancelEvent.cs
- RemotingConfiguration.cs
- Tokenizer.cs
- WebServiceData.cs
- DetailsViewCommandEventArgs.cs
- XmlDeclaration.cs
- EmbossBitmapEffect.cs
- ExpressionVisitor.cs
- IndependentAnimationStorage.cs
- SafeRegistryHandle.cs
- PageTheme.cs
- PerspectiveCamera.cs
- GridViewItemAutomationPeer.cs
- CaretElement.cs
- UnSafeCharBuffer.cs
- EntitySetBaseCollection.cs
- SerializationHelper.cs
- DbDataSourceEnumerator.cs
- OleDbRowUpdatedEvent.cs
- ReadOnlyCollection.cs
- ObjRef.cs
- DetailsViewInsertEventArgs.cs
- TextTreeInsertElementUndoUnit.cs
- AppDomainFactory.cs
- XmlDocumentViewSchema.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- IMembershipProvider.cs
- StylusDownEventArgs.cs
- _UncName.cs
- StreamInfo.cs
- DeobfuscatingStream.cs
- MultiPropertyDescriptorGridEntry.cs
- MarginsConverter.cs
- LastQueryOperator.cs
- TrackingParameters.cs
- prefixendpointaddressmessagefiltertable.cs
- HijriCalendar.cs
- GraphicsState.cs
- MultipartIdentifier.cs
- ScrollBar.cs
- GeneralEndpointIdentity.cs
- FrameworkContentElement.cs
- NestPullup.cs
- TypeConstant.cs
- NativeMethods.cs
- Binding.cs
- ResourceReferenceExpression.cs
- WindowsRegion.cs
- NamespaceListProperty.cs
- EditBehavior.cs
- MergablePropertyAttribute.cs
- shaperfactoryquerycachekey.cs
- xmlsaver.cs
- SamlSerializer.cs
- TdsParserSafeHandles.cs
- XmlQuerySequence.cs
- Pair.cs
- FloaterBaseParaClient.cs
- IProvider.cs
- PipeStream.cs
- ProfilePropertySettings.cs
- ViewBox.cs
- MenuAutomationPeer.cs
- ListDictionaryInternal.cs
- DataTableTypeConverter.cs
- HtmlInputImage.cs
- TdsParserStateObject.cs
- SourceElementsCollection.cs
- SessionParameter.cs
- SmuggledIUnknown.cs
- ContextQuery.cs
- DependencyPropertyChangedEventArgs.cs
- RoleGroupCollection.cs
- SolidColorBrush.cs
- HighlightComponent.cs
- TextDecorationCollection.cs
- Decoder.cs
- ClusterRegistryConfigurationProvider.cs
- WsdlBuildProvider.cs
- InkCollectionBehavior.cs
- TransformedBitmap.cs
- OpCopier.cs
- XmlReflectionImporter.cs
- OleDbEnumerator.cs
- MetafileHeaderWmf.cs
- AutomationPropertyInfo.cs
- TextMarkerSource.cs
- ToolStripContentPanelRenderEventArgs.cs
- CompilerCollection.cs
- SafeUserTokenHandle.cs
- SectionInformation.cs
- TableCellCollection.cs
- COAUTHIDENTITY.cs