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
- SharedDp.cs
- Misc.cs
- WebControlToolBoxItem.cs
- CodeLinePragma.cs
- XmlTypeMapping.cs
- ResolvedKeyFrameEntry.cs
- ApplicationDirectoryMembershipCondition.cs
- EllipseGeometry.cs
- ConfigXmlElement.cs
- MsmqAuthenticationMode.cs
- TraceHwndHost.cs
- SerialPinChanges.cs
- IntegerValidatorAttribute.cs
- MachineKeySection.cs
- TrackingMemoryStreamFactory.cs
- FunctionCommandText.cs
- WebZone.cs
- GetImportFileNameRequest.cs
- LinqDataSourceSelectEventArgs.cs
- Rectangle.cs
- Selection.cs
- _SslSessionsCache.cs
- LoadedOrUnloadedOperation.cs
- TemplateBamlTreeBuilder.cs
- TextBlock.cs
- DataReceivedEventArgs.cs
- MsmqOutputSessionChannel.cs
- ProfileProvider.cs
- OleDbConnection.cs
- ManagementEventArgs.cs
- DragEvent.cs
- BitmapEffectGroup.cs
- DependencyProperty.cs
- ResourceDescriptionAttribute.cs
- PropertyEmitter.cs
- SettingsContext.cs
- DataGridViewRowStateChangedEventArgs.cs
- RtfFormatStack.cs
- DiscardableAttribute.cs
- ForEachAction.cs
- ByteAnimationUsingKeyFrames.cs
- BinaryCommonClasses.cs
- SelectionEditor.cs
- ClientRequest.cs
- StorageMappingFragment.cs
- ZoneButton.cs
- NumberFormatInfo.cs
- BamlMapTable.cs
- ScrollPattern.cs
- BitmapEffectGroup.cs
- ContentPresenter.cs
- WizardForm.cs
- Message.cs
- CategoryAttribute.cs
- WebBrowserPermission.cs
- ProfilePropertySettingsCollection.cs
- SoapHeaderAttribute.cs
- FormsAuthenticationUserCollection.cs
- DSACryptoServiceProvider.cs
- OneWayBindingElement.cs
- ExtenderControl.cs
- AssemblyResourceLoader.cs
- ComponentChangedEvent.cs
- Margins.cs
- CommittableTransaction.cs
- RowUpdatedEventArgs.cs
- DragDrop.cs
- SqlCacheDependencyDatabase.cs
- SynchronousChannel.cs
- XamlClipboardData.cs
- EditorPartDesigner.cs
- DATA_BLOB.cs
- ThreadStartException.cs
- BitmapVisualManager.cs
- Route.cs
- BitmapPalette.cs
- SoapFormatter.cs
- ZipIOBlockManager.cs
- FillBehavior.cs
- ListenerTraceUtility.cs
- BindableTemplateBuilder.cs
- InternalRelationshipCollection.cs
- StrokeNode.cs
- PropertySegmentSerializationProvider.cs
- SecurityException.cs
- TaskExtensions.cs
- LogSwitch.cs
- CellPartitioner.cs
- TextReturnReader.cs
- CollectionsUtil.cs
- XpsSerializationException.cs
- Attributes.cs
- ProfileSection.cs
- HostedTransportConfigurationManager.cs
- WindowProviderWrapper.cs
- PtsHelper.cs
- DotAtomReader.cs
- ComponentEditorForm.cs
- LookupBindingPropertiesAttribute.cs
- ComponentEditorForm.cs