Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / xsp / System / Web / UI / WebParts / ProviderConnectionPointCollection.cs / 1 / ProviderConnectionPointCollection.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Web.UI.WebControls.WebParts {
using System;
using System.Collections;
using System.Collections.Specialized;
using System.Globalization;
using System.Security.Permissions;
[AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)]
public sealed class ProviderConnectionPointCollection : ReadOnlyCollectionBase {
private HybridDictionary _ids;
public ProviderConnectionPointCollection() {
}
public ProviderConnectionPointCollection(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");
}
ProviderConnectionPoint point = obj as ProviderConnectionPoint;
if (point == null) {
throw new ArgumentException(SR.GetString(SR.Collection_InvalidType, "ProviderConnectionPoint"),
"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, "ProviderConnectionPoint", id), "connectionPoints");
}
}
}
public ProviderConnectionPoint Default {
get {
return this[ConnectionPoint.DefaultID];
}
}
public ProviderConnectionPoint this[int index] {
get {
return (ProviderConnectionPoint)InnerList[index];
}
}
public ProviderConnectionPoint this[string id] {
get {
return ((_ids != null) ? (ProviderConnectionPoint)_ids[id] : null);
}
}
public bool Contains(ProviderConnectionPoint connectionPoint) {
return InnerList.Contains(connectionPoint);
}
public int IndexOf(ProviderConnectionPoint connectionPoint) {
return InnerList.IndexOf(connectionPoint);
}
public void CopyTo(ProviderConnectionPoint[] 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;
using System.Collections;
using System.Collections.Specialized;
using System.Globalization;
using System.Security.Permissions;
[AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)]
public sealed class ProviderConnectionPointCollection : ReadOnlyCollectionBase {
private HybridDictionary _ids;
public ProviderConnectionPointCollection() {
}
public ProviderConnectionPointCollection(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");
}
ProviderConnectionPoint point = obj as ProviderConnectionPoint;
if (point == null) {
throw new ArgumentException(SR.GetString(SR.Collection_InvalidType, "ProviderConnectionPoint"),
"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, "ProviderConnectionPoint", id), "connectionPoints");
}
}
}
public ProviderConnectionPoint Default {
get {
return this[ConnectionPoint.DefaultID];
}
}
public ProviderConnectionPoint this[int index] {
get {
return (ProviderConnectionPoint)InnerList[index];
}
}
public ProviderConnectionPoint this[string id] {
get {
return ((_ids != null) ? (ProviderConnectionPoint)_ids[id] : null);
}
}
public bool Contains(ProviderConnectionPoint connectionPoint) {
return InnerList.Contains(connectionPoint);
}
public int IndexOf(ProviderConnectionPoint connectionPoint) {
return InnerList.IndexOf(connectionPoint);
}
public void CopyTo(ProviderConnectionPoint[] 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
- PolicyAssertionCollection.cs
- DocumentEventArgs.cs
- NamedPipeTransportSecurity.cs
- ISAPIRuntime.cs
- CodePropertyReferenceExpression.cs
- IssuedSecurityTokenParameters.cs
- ProviderSettingsCollection.cs
- OleDbParameter.cs
- AppearanceEditorPart.cs
- Win32SafeHandles.cs
- ZipIOLocalFileDataDescriptor.cs
- BitVector32.cs
- ErrorCodes.cs
- Win32PrintDialog.cs
- MimeMultiPart.cs
- DiscriminatorMap.cs
- MessageOperationFormatter.cs
- RuleDefinitions.cs
- HyperLink.cs
- HelpProvider.cs
- DecimalMinMaxAggregationOperator.cs
- EmbeddedMailObject.cs
- ElementMarkupObject.cs
- glyphs.cs
- RawContentTypeMapper.cs
- LocatorBase.cs
- BaseResourcesBuildProvider.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- StringAnimationUsingKeyFrames.cs
- StopRoutingHandler.cs
- CallbackException.cs
- SqlDataSourceStatusEventArgs.cs
- PropertyManager.cs
- XmlElementList.cs
- CodeThrowExceptionStatement.cs
- HostingEnvironmentWrapper.cs
- SqlNotificationRequest.cs
- RoutedPropertyChangedEventArgs.cs
- ResourceProviderFactory.cs
- DateTimeConverter.cs
- Renderer.cs
- CodeArrayIndexerExpression.cs
- SizeChangedInfo.cs
- PackWebResponse.cs
- UnsafeNativeMethods.cs
- AutoGeneratedField.cs
- HandleCollector.cs
- Assembly.cs
- TreeWalkHelper.cs
- WebPartEditorOkVerb.cs
- TextPointer.cs
- BufferBuilder.cs
- GenericUriParser.cs
- HybridObjectCache.cs
- RedistVersionInfo.cs
- PersistChildrenAttribute.cs
- CompilerResults.cs
- TransformCollection.cs
- PreviewPrintController.cs
- ProtocolInformationReader.cs
- LicenseProviderAttribute.cs
- HtmlInputFile.cs
- MimeMultiPart.cs
- ColorContextHelper.cs
- DependencyPropertyChangedEventArgs.cs
- WsdlWriter.cs
- TdsParserSessionPool.cs
- X509CertificateInitiatorServiceCredential.cs
- ColorDialog.cs
- ExpanderAutomationPeer.cs
- AttributeQuery.cs
- CompoundFileIOPermission.cs
- PublisherIdentityPermission.cs
- CollectionViewSource.cs
- RedistVersionInfo.cs
- SqlCacheDependencyDatabaseCollection.cs
- ExtentJoinTreeNode.cs
- SecurityContextSecurityTokenParameters.cs
- ToolboxDataAttribute.cs
- BoundColumn.cs
- AsynchronousChannelMergeEnumerator.cs
- PlanCompiler.cs
- MsdtcWrapper.cs
- PropertyManager.cs
- Brush.cs
- ClientUrlResolverWrapper.cs
- KnownTypesHelper.cs
- TraceInternal.cs
- TextContainerHelper.cs
- CounterCreationDataConverter.cs
- Mouse.cs
- XmlDataCollection.cs
- QilNode.cs
- TraceSource.cs
- DataGridComboBoxColumn.cs
- ReflectEventDescriptor.cs
- DesignerLabelAdapter.cs
- ApplicationServiceHelper.cs
- EntityContainer.cs
- FixedSOMTextRun.cs