Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / UI / WebParts / CatalogPartCollection.cs / 1305376 / CatalogPartCollection.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.WebControls.WebParts { using System; using System.Collections; using System.Globalization; 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 check arg, since we know it is valid since it came // from a CatalogPartCollection. 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- MetadataItemCollectionFactory.cs
- SecurityHelper.cs
- DataComponentNameHandler.cs
- StreamGeometryContext.cs
- PreservationFileWriter.cs
- GZipDecoder.cs
- InvalidOperationException.cs
- DragDrop.cs
- BamlLocalizationDictionary.cs
- XmlnsDictionary.cs
- TreeViewImageGenerator.cs
- ConstantProjectedSlot.cs
- BuildProvider.cs
- UIPermission.cs
- SystemBrushes.cs
- PcmConverter.cs
- ChangeToolStripParentVerb.cs
- ToolstripProfessionalRenderer.cs
- RuleRef.cs
- storepermission.cs
- KeyInstance.cs
- MissingManifestResourceException.cs
- ActivitySurrogateSelector.cs
- ColorIndependentAnimationStorage.cs
- ArrayElementGridEntry.cs
- DataSourceExpressionCollection.cs
- QilInvoke.cs
- Group.cs
- XmlEntityReference.cs
- PartialCachingControl.cs
- Page.cs
- ConfigurationManagerHelper.cs
- RichTextBoxDesigner.cs
- PersonalizationEntry.cs
- DispatchChannelSink.cs
- Mutex.cs
- LayoutDump.cs
- BinaryParser.cs
- ComplexPropertyEntry.cs
- WindowsRegion.cs
- XmlBinaryWriterSession.cs
- AuthenticationService.cs
- PingReply.cs
- RowParagraph.cs
- CorrelationManager.cs
- EntityDataSourceContainerNameConverter.cs
- ToolbarAUtomationPeer.cs
- FragmentQueryKB.cs
- DataGridViewAutoSizeModeEventArgs.cs
- Speller.cs
- ToolStripHighContrastRenderer.cs
- XmlUrlEditor.cs
- ByteAnimationUsingKeyFrames.cs
- TextEditorThreadLocalStore.cs
- AxisAngleRotation3D.cs
- SamlConstants.cs
- TextElement.cs
- ActivationServices.cs
- EventMappingSettingsCollection.cs
- BamlTreeUpdater.cs
- BreakSafeBase.cs
- HttpHandlersSection.cs
- ViewgenGatekeeper.cs
- BrowserCapabilitiesCodeGenerator.cs
- LowerCaseStringConverter.cs
- WsdlHelpGeneratorElement.cs
- DataGridViewAutoSizeModeEventArgs.cs
- X509InitiatorCertificateServiceElement.cs
- SecurityTokenAuthenticator.cs
- X509CertificateStore.cs
- SymLanguageVendor.cs
- NetNamedPipeSecurity.cs
- DataSourceExpression.cs
- TypedOperationInfo.cs
- Misc.cs
- FlowDocument.cs
- PriorityRange.cs
- XmlSerializer.cs
- TransactionManager.cs
- MarginsConverter.cs
- SQLDateTimeStorage.cs
- StateDesigner.TransitionInfo.cs
- XmlCollation.cs
- CodeSpit.cs
- Pointer.cs
- MergeEnumerator.cs
- CodeVariableReferenceExpression.cs
- IsolatedStorageSecurityState.cs
- GeometryHitTestResult.cs
- ServiceMetadataPublishingElement.cs
- BinaryUtilClasses.cs
- DateTimePicker.cs
- DrawingContext.cs
- XmlCompatibilityReader.cs
- Expander.cs
- AssemblyBuilder.cs
- ConstrainedGroup.cs
- XmlSchemaType.cs
- EntityDataSourceState.cs
- OleDbPropertySetGuid.cs