Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / ndp / fx / src / xsp / System / Web / UI / WebParts / WebPartDescriptionCollection.cs / 1 / WebPartDescriptionCollection.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.ComponentModel; using System.Globalization; using System.Security.Permissions; [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] public sealed class WebPartDescriptionCollection : ReadOnlyCollectionBase { private HybridDictionary _ids; public WebPartDescriptionCollection() { } public WebPartDescriptionCollection(ICollection webPartDescriptions) { if (webPartDescriptions == null) { throw new ArgumentNullException("webPartDescriptions"); } _ids = new HybridDictionary(webPartDescriptions.Count, true /* caseInsensitive */); foreach (object obj in webPartDescriptions) { if (obj == null) { throw new ArgumentException(SR.GetString(SR.Collection_CantAddNull), "webPartDescriptions"); } WebPartDescription description = obj as WebPartDescription; if (description == null) { throw new ArgumentException(SR.GetString(SR.Collection_InvalidType, "WebPartDescription"), "webPartDescriptions"); } string id = description.ID; if (!_ids.Contains(id)) { InnerList.Add(description); _ids.Add(id, description); } else { throw new ArgumentException(SR.GetString( SR.WebPart_Collection_DuplicateID, "WebPartDescription", id), "webPartDescriptions"); } } } public bool Contains(WebPartDescription value) { return InnerList.Contains(value); } public int IndexOf(WebPartDescription value) { return InnerList.IndexOf(value); } public WebPartDescription this[int index] { get { return (WebPartDescription) InnerList[index]; } } public WebPartDescription this[string id] { get { return ((_ids != null) ? (WebPartDescription)_ids[id] : null); } } public void CopyTo(WebPartDescription[] 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DataSetViewSchema.cs
- SafeRegistryKey.cs
- TextDataBindingHandler.cs
- PointConverter.cs
- DataListDesigner.cs
- MouseDevice.cs
- TokenizerHelper.cs
- VectorCollectionValueSerializer.cs
- BindingSourceDesigner.cs
- XslTransformFileEditor.cs
- VersionedStreamOwner.cs
- SvcMapFile.cs
- SchemaImporterExtensionsSection.cs
- COM2EnumConverter.cs
- SqlServices.cs
- COAUTHIDENTITY.cs
- Vector3DValueSerializer.cs
- InternalBufferOverflowException.cs
- ReflectEventDescriptor.cs
- ComNativeDescriptor.cs
- ExpressionEditorAttribute.cs
- ManifestResourceInfo.cs
- WindowsScrollBar.cs
- PageBuildProvider.cs
- TextDecorationUnitValidation.cs
- VisualStyleTypesAndProperties.cs
- cache.cs
- InfoCardAsymmetricCrypto.cs
- StylusPoint.cs
- NamespaceQuery.cs
- ResourceCategoryAttribute.cs
- TypeElementCollection.cs
- BaseTemplateParser.cs
- ConnectionManagementElement.cs
- WindowsSpinner.cs
- AuthenticationService.cs
- XmlLanguage.cs
- TypeConverterHelper.cs
- SecurityCredentialsManager.cs
- ArglessEventHandlerProxy.cs
- XPathNodeList.cs
- FontFamily.cs
- TableSectionStyle.cs
- BitSet.cs
- WorkflowInlining.cs
- StreamInfo.cs
- RSAOAEPKeyExchangeDeformatter.cs
- EventItfInfo.cs
- ProxySimple.cs
- CodeLabeledStatement.cs
- ChtmlLinkAdapter.cs
- PtsHost.cs
- SmiSettersStream.cs
- SqlUtil.cs
- ArglessEventHandlerProxy.cs
- ItemCheckEvent.cs
- _PooledStream.cs
- ChameleonKey.cs
- CustomAttributeFormatException.cs
- XmlAnyAttributeAttribute.cs
- DesigntimeLicenseContext.cs
- TimeSpanMinutesConverter.cs
- BinaryKeyIdentifierClause.cs
- Trace.cs
- CodeTypeDeclaration.cs
- SoapExtensionStream.cs
- CookielessHelper.cs
- ServiceOperationListItem.cs
- CAGDesigner.cs
- ImageInfo.cs
- ProcessInfo.cs
- SafeThreadHandle.cs
- TCEAdapterGenerator.cs
- ReadOnlyDictionary.cs
- ObjectAnimationUsingKeyFrames.cs
- LicenseContext.cs
- HMACMD5.cs
- OptimizedTemplateContentHelper.cs
- IntegerValidatorAttribute.cs
- BitmapInitialize.cs
- SelectionHighlightInfo.cs
- MetadataPropertyvalue.cs
- MaterialGroup.cs
- VBIdentifierName.cs
- Wildcard.cs
- StrokeCollection2.cs
- ProfileService.cs
- PermissionSet.cs
- CodeThrowExceptionStatement.cs
- BitmapEffectGeneralTransform.cs
- GroupPartitionExpr.cs
- FragmentNavigationEventArgs.cs
- SchemaElement.cs
- StateMachineSubscription.cs
- MiniAssembly.cs
- _LoggingObject.cs
- GAC.cs
- MiniCustomAttributeInfo.cs
- AttributeXamlType.cs
- WebExceptionStatus.cs