Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / UI / WebParts / EditorPartCollection.cs / 1305376 / EditorPartCollection.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.WebControls.WebParts { using System; using System.Collections; public sealed class EditorPartCollection : ReadOnlyCollectionBase { public static readonly EditorPartCollection Empty = new EditorPartCollection(); public EditorPartCollection() { } public EditorPartCollection(ICollection editorParts) { Initialize(null, editorParts); } public EditorPartCollection(EditorPartCollection existingEditorParts, ICollection editorParts) { Initialize(existingEditorParts, editorParts); } public EditorPart this[int index] { get { return (EditorPart) InnerList[index]; } } internal int Add(EditorPart value) { return InnerList.Add(value); } public bool Contains(EditorPart editorPart) { return InnerList.Contains(editorPart); } public void CopyTo(EditorPart[] array, int index) { InnerList.CopyTo(array, index); } public int IndexOf(EditorPart editorPart) { return InnerList.IndexOf(editorPart); } private void Initialize(EditorPartCollection existingEditorParts, ICollection editorParts) { if (existingEditorParts != null) { foreach (EditorPart existingEditorPart in existingEditorParts) { // Don't need to check arg, since we know it is valid since it came // from an EditorPartCollection. InnerList.Add(existingEditorPart); } } if (editorParts != null) { foreach (object obj in editorParts) { if (obj == null) { throw new ArgumentException(SR.GetString(SR.Collection_CantAddNull), "editorParts"); } if (!(obj is EditorPart)) { throw new ArgumentException(SR.GetString(SR.Collection_InvalidType, "EditorPart"), "editorParts"); } 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; public sealed class EditorPartCollection : ReadOnlyCollectionBase { public static readonly EditorPartCollection Empty = new EditorPartCollection(); public EditorPartCollection() { } public EditorPartCollection(ICollection editorParts) { Initialize(null, editorParts); } public EditorPartCollection(EditorPartCollection existingEditorParts, ICollection editorParts) { Initialize(existingEditorParts, editorParts); } public EditorPart this[int index] { get { return (EditorPart) InnerList[index]; } } internal int Add(EditorPart value) { return InnerList.Add(value); } public bool Contains(EditorPart editorPart) { return InnerList.Contains(editorPart); } public void CopyTo(EditorPart[] array, int index) { InnerList.CopyTo(array, index); } public int IndexOf(EditorPart editorPart) { return InnerList.IndexOf(editorPart); } private void Initialize(EditorPartCollection existingEditorParts, ICollection editorParts) { if (existingEditorParts != null) { foreach (EditorPart existingEditorPart in existingEditorParts) { // Don't need to check arg, since we know it is valid since it came // from an EditorPartCollection. InnerList.Add(existingEditorPart); } } if (editorParts != null) { foreach (object obj in editorParts) { if (obj == null) { throw new ArgumentException(SR.GetString(SR.Collection_CantAddNull), "editorParts"); } if (!(obj is EditorPart)) { throw new ArgumentException(SR.GetString(SR.Collection_InvalidType, "EditorPart"), "editorParts"); } 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
- MonitorWrapper.cs
- XmlComplianceUtil.cs
- DataGridViewColumnStateChangedEventArgs.cs
- XPathParser.cs
- SqlFunctions.cs
- HashCryptoHandle.cs
- ParallelEnumerable.cs
- ReferencedCollectionType.cs
- ClientSideProviderDescription.cs
- DbLambda.cs
- ErrorStyle.cs
- TimeoutHelper.cs
- FusionWrap.cs
- _NestedSingleAsyncResult.cs
- DataBinder.cs
- SecurityPermission.cs
- StylusCollection.cs
- ExpressionVisitorHelpers.cs
- PointHitTestParameters.cs
- GeneralTransform3DCollection.cs
- XmlDataDocument.cs
- ReferenceEqualityComparer.cs
- RenderingEventArgs.cs
- IntranetCredentialPolicy.cs
- CodeTypeDelegate.cs
- HtmlTableRow.cs
- Perspective.cs
- future.cs
- MailDefinition.cs
- TextEditorParagraphs.cs
- StyleTypedPropertyAttribute.cs
- OdbcUtils.cs
- NoClickablePointException.cs
- StorageModelBuildProvider.cs
- PageOutputQuality.cs
- HexParser.cs
- AggregateException.cs
- SourceElementsCollection.cs
- CollectionChangedEventManager.cs
- DesignSurface.cs
- EnterpriseServicesHelper.cs
- CalculatedColumn.cs
- CompareInfo.cs
- WindowsImpersonationContext.cs
- TableCell.cs
- SingleKeyFrameCollection.cs
- CachedBitmap.cs
- XmlMtomWriter.cs
- ThousandthOfEmRealPoints.cs
- SQLCharsStorage.cs
- ProxyWebPartManager.cs
- WebResourceAttribute.cs
- HebrewNumber.cs
- FrameworkElement.cs
- ObjectContextServiceProvider.cs
- SingleStorage.cs
- OdbcEnvironmentHandle.cs
- ListBoxItem.cs
- ProcessingInstructionAction.cs
- WmfPlaceableFileHeader.cs
- NumericUpDownAccelerationCollection.cs
- DataControlImageButton.cs
- CodeTypeReferenceExpression.cs
- ThemeInfoAttribute.cs
- SmtpReplyReaderFactory.cs
- TemplateNameScope.cs
- CultureSpecificStringDictionary.cs
- WmlTextViewAdapter.cs
- MessagePropertyFilter.cs
- PrintEvent.cs
- DependencyPropertyAttribute.cs
- ColorMap.cs
- RegistryDataKey.cs
- DrawItemEvent.cs
- DataMemberFieldConverter.cs
- XmlC14NWriter.cs
- BCLDebug.cs
- TableCellsCollectionEditor.cs
- DbParameterCollectionHelper.cs
- DirectoryRootQuery.cs
- FixedTextPointer.cs
- PagedDataSource.cs
- SafePipeHandle.cs
- VirtualPathUtility.cs
- TextBoxAutoCompleteSourceConverter.cs
- StretchValidation.cs
- TypeUtil.cs
- ValidationError.cs
- WizardPanel.cs
- DisposableCollectionWrapper.cs
- DataFormats.cs
- TaiwanLunisolarCalendar.cs
- ErrorView.xaml.cs
- Metafile.cs
- Attributes.cs
- XmlSchemaObjectCollection.cs
- FormViewAutoFormat.cs
- XmlQualifiedName.cs
- ServiceHttpModule.cs
- TogglePatternIdentifiers.cs