Code:
/ 4.0 / 4.0 / 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. //------------------------------------------------------------------------------ //// 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
- SqlWebEventProvider.cs
- SHA384Managed.cs
- RichTextBoxDesigner.cs
- TagPrefixAttribute.cs
- LinqDataSource.cs
- LinqDataSourceStatusEventArgs.cs
- NativeMethods.cs
- DocumentReferenceCollection.cs
- DesignerDeviceConfig.cs
- CellIdBoolean.cs
- CustomCategoryAttribute.cs
- VectorCollectionConverter.cs
- ReliableSessionElement.cs
- LayoutDump.cs
- WeakReadOnlyCollection.cs
- ImmComposition.cs
- DataGridItemCollection.cs
- DataGridViewCellCollection.cs
- ToolTip.cs
- WindowsFormsHostPropertyMap.cs
- _SSPISessionCache.cs
- MenuItemAutomationPeer.cs
- DbDataReader.cs
- LassoHelper.cs
- FastEncoderStatics.cs
- CompoundFileStorageReference.cs
- _Connection.cs
- MultiBindingExpression.cs
- DocumentReference.cs
- PageAsyncTaskManager.cs
- GlyphingCache.cs
- LambdaCompiler.Unary.cs
- IndexedEnumerable.cs
- ProbeMatchesCD1.cs
- InputProcessorProfiles.cs
- SplitterCancelEvent.cs
- XPathNodeHelper.cs
- ToggleButton.cs
- EncryptedType.cs
- XPathNodeList.cs
- SchemaType.cs
- HttpDictionary.cs
- HealthMonitoringSection.cs
- DataGridViewSelectedRowCollection.cs
- SortExpressionBuilder.cs
- ScrollChrome.cs
- LinearKeyFrames.cs
- RootProfilePropertySettingsCollection.cs
- PageRouteHandler.cs
- CodeIdentifier.cs
- WizardForm.cs
- XmlSchemaElement.cs
- FlowPosition.cs
- TableLayoutStyleCollection.cs
- ProgressBar.cs
- XmlSequenceWriter.cs
- InputScopeNameConverter.cs
- ObfuscateAssemblyAttribute.cs
- HttpProfileGroupBase.cs
- SystemWebSectionGroup.cs
- PropertyTabChangedEvent.cs
- ItemsPresenter.cs
- FreezableCollection.cs
- SeparatorAutomationPeer.cs
- XmlSchemaObject.cs
- EntityDataSourceWrapperPropertyDescriptor.cs
- ProfileProvider.cs
- WinCategoryAttribute.cs
- HGlobalSafeHandle.cs
- HtmlHead.cs
- CryptoConfig.cs
- UserPreferenceChangingEventArgs.cs
- Vector3DValueSerializer.cs
- parserscommon.cs
- WebPartExportVerb.cs
- SchemaImporter.cs
- _BufferOffsetSize.cs
- PrimitiveCodeDomSerializer.cs
- ReferencedCollectionType.cs
- XmlTextWriter.cs
- BitmapEffectOutputConnector.cs
- XmlTypeAttribute.cs
- UnsupportedPolicyOptionsException.cs
- ResourceReader.cs
- _Rfc2616CacheValidators.cs
- UserControlCodeDomTreeGenerator.cs
- ConfigurationStrings.cs
- HMACSHA384.cs
- CodeDomComponentSerializationService.cs
- ApplicationDirectory.cs
- ConfigurationElement.cs
- ContentDisposition.cs
- MultiAsyncResult.cs
- SerializableReadOnlyDictionary.cs
- OracleRowUpdatingEventArgs.cs
- DataSourceListEditor.cs
- HttpCookieCollection.cs
- DataServiceOperationContext.cs
- XamlClipboardData.cs
- HttpCookieCollection.cs