Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / ndp / fx / src / xsp / System / Web / UI / WebParts / CatalogPartCollection.cs / 2 / CatalogPartCollection.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.WebControls.WebParts { using System; using System.Collections; using System.Globalization; using System.Security.Permissions; [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] public sealed class CatalogPartCollection : ReadOnlyCollectionBase { public static readonly CatalogPartCollection Empty = new CatalogPartCollection(); public CatalogPartCollection() { } public CatalogPartCollection(ICollection catalogParts) { Initialize(null, catalogParts); } public CatalogPartCollection(CatalogPartCollection existingCatalogParts, ICollection catalogParts) { Initialize(existingCatalogParts, catalogParts); } public CatalogPart this[int index] { get { return (CatalogPart) InnerList[index]; } } public CatalogPart this[string id] { get { foreach (CatalogPart catalogPart in InnerList) { if (String.Equals(catalogPart.ID, id, StringComparison.OrdinalIgnoreCase)) { return catalogPart; } } return null; } } internal int Add(CatalogPart value) { return InnerList.Add(value); } public bool Contains(CatalogPart catalogPart) { return InnerList.Contains(catalogPart); } public void CopyTo(CatalogPart[] array, int index) { InnerList.CopyTo(array, index); } public int IndexOf(CatalogPart catalogPart) { return InnerList.IndexOf(catalogPart); } private void Initialize(CatalogPartCollection existingCatalogParts, ICollection catalogParts) { if (existingCatalogParts != null) { foreach (CatalogPart existingCatalogPart in existingCatalogParts) { // Don't need to InnerList.Add(existingCatalogPart); } } if (catalogParts != null) { foreach (object obj in catalogParts) { if (obj == null) { throw new ArgumentException(SR.GetString(SR.Collection_CantAddNull), "catalogParts"); } if (!(obj is CatalogPart)) { throw new ArgumentException(SR.GetString(SR.Collection_InvalidType, "CatalogPart"), "catalogParts"); } InnerList.Add(obj); } } } } } // 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
- BaseDataBoundControlDesigner.cs
- _BufferOffsetSize.cs
- DataGridViewSelectedRowCollection.cs
- DbConnectionOptions.cs
- ResourceProviderFactory.cs
- AppDomainUnloadedException.cs
- GenericsInstances.cs
- DecodeHelper.cs
- MergeFailedEvent.cs
- assertwrapper.cs
- Propagator.cs
- GridViewRowPresenterBase.cs
- AppDomainUnloadedException.cs
- PersistChildrenAttribute.cs
- MultilineStringConverter.cs
- ResXFileRef.cs
- IChannel.cs
- Metadata.cs
- XmlNamespaceManager.cs
- AlternationConverter.cs
- ResourceAssociationSet.cs
- SqlCacheDependencySection.cs
- Enlistment.cs
- HtmlUtf8RawTextWriter.cs
- AmbientLight.cs
- PinnedBufferMemoryStream.cs
- PiiTraceSource.cs
- DetailsViewDeleteEventArgs.cs
- TraceProvider.cs
- ToolStripContextMenu.cs
- CaseInsensitiveHashCodeProvider.cs
- QilInvokeEarlyBound.cs
- EventDriven.cs
- TextElementEnumerator.cs
- WinFormsComponentEditor.cs
- Bits.cs
- ReflectTypeDescriptionProvider.cs
- ProjectionRewriter.cs
- DataDocumentXPathNavigator.cs
- DataRecordObjectView.cs
- DocumentPageTextView.cs
- ApplicationException.cs
- SqlFunctionAttribute.cs
- FileChangesMonitor.cs
- CodeSnippetStatement.cs
- ExpressionsCollectionConverter.cs
- SearchForVirtualItemEventArgs.cs
- SmiRequestExecutor.cs
- HMACSHA384.cs
- ConnectionStringsExpressionEditor.cs
- MarshalByRefObject.cs
- ConfigurationManagerHelperFactory.cs
- BamlResourceContent.cs
- BinaryUtilClasses.cs
- Transform.cs
- ConfigXmlText.cs
- AccessedThroughPropertyAttribute.cs
- AsyncSerializedWorker.cs
- NotificationContext.cs
- PointConverter.cs
- AndMessageFilterTable.cs
- ToolStripLabel.cs
- RuntimeCompatibilityAttribute.cs
- XhtmlBasicPhoneCallAdapter.cs
- ConfigurationStrings.cs
- Tuple.cs
- Avt.cs
- UniqueConstraint.cs
- dbdatarecord.cs
- FontStretches.cs
- StringToken.cs
- ParameterCollection.cs
- CommandSet.cs
- RuntimeConfig.cs
- HashCryptoHandle.cs
- Operand.cs
- ProcessModule.cs
- TraceRecord.cs
- DescendantBaseQuery.cs
- FontCollection.cs
- TreePrinter.cs
- ImageAttributes.cs
- SystemPens.cs
- DataSourceExpressionCollection.cs
- SocketSettings.cs
- SpellerError.cs
- RectangleConverter.cs
- UnmanagedBitmapWrapper.cs
- FloaterParagraph.cs
- FormattedText.cs
- StoreUtilities.cs
- HttpBrowserCapabilitiesBase.cs
- CachedBitmap.cs
- dataSvcMapFileLoader.cs
- LicenseContext.cs
- XmlSchemaType.cs
- Bits.cs
- BooleanFunctions.cs
- HuffmanTree.cs
- ToolStripSplitStackLayout.cs