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
- COM2TypeInfoProcessor.cs
- UrlPath.cs
- OutputWindow.cs
- TabControlCancelEvent.cs
- ControlTemplate.cs
- ConfigurationSection.cs
- Pen.cs
- MobileControlDesigner.cs
- LayoutManager.cs
- Decorator.cs
- _TransmitFileOverlappedAsyncResult.cs
- CreateUserWizardStep.cs
- TrackingParameters.cs
- DbQueryCommandTree.cs
- TypeAccessException.cs
- PropertyCondition.cs
- QilLoop.cs
- TextSchema.cs
- MenuRenderer.cs
- ContentValidator.cs
- ConstrainedDataObject.cs
- XComponentModel.cs
- FileUtil.cs
- DesignerDataSchemaClass.cs
- RIPEMD160Managed.cs
- ConnectionOrientedTransportManager.cs
- NavigationPropertyAccessor.cs
- PointAnimationUsingPath.cs
- TextEndOfSegment.cs
- CodeArrayCreateExpression.cs
- ControlPropertyNameConverter.cs
- ObjectDataSourceFilteringEventArgs.cs
- UriScheme.cs
- DirectoryInfo.cs
- ComboBoxItem.cs
- xdrvalidator.cs
- WSFederationHttpBindingElement.cs
- DataViewSetting.cs
- WebPermission.cs
- Path.cs
- CLSCompliantAttribute.cs
- SubqueryRules.cs
- FormatterServices.cs
- SqlDataReaderSmi.cs
- MethodBuilder.cs
- ObservableDictionary.cs
- SmtpTransport.cs
- MatrixTransform.cs
- WorkflowWebService.cs
- NullEntityWrapper.cs
- InputMethodStateChangeEventArgs.cs
- CapabilitiesPattern.cs
- JsonReaderDelegator.cs
- Brush.cs
- Axis.cs
- DataServiceStreamProviderWrapper.cs
- ResourceExpression.cs
- WebPartZoneCollection.cs
- WasNotInstalledException.cs
- UnknownBitmapEncoder.cs
- SequentialOutput.cs
- WorkflowElementDialog.cs
- PhonemeConverter.cs
- sqlmetadatafactory.cs
- FilteredDataSetHelper.cs
- XmlDocumentType.cs
- ObjectDataSourceEventArgs.cs
- HttpRequest.cs
- ChangeNode.cs
- VSWCFServiceContractGenerator.cs
- TextBreakpoint.cs
- MessageCredentialType.cs
- SymmetricKeyWrap.cs
- CodeTypeDeclarationCollection.cs
- PenContexts.cs
- RealProxy.cs
- PropertyItemInternal.cs
- DataGridRowDetailsEventArgs.cs
- ControlPaint.cs
- KeyEventArgs.cs
- GestureRecognizer.cs
- CodeSubDirectoriesCollection.cs
- ListViewItemMouseHoverEvent.cs
- HttpBrowserCapabilitiesWrapper.cs
- ToolStripItem.cs
- ExtendedPropertiesHandler.cs
- loginstatus.cs
- NotSupportedException.cs
- TextDecorationUnitValidation.cs
- OdbcConnectionStringbuilder.cs
- NameValueFileSectionHandler.cs
- ResumeStoryboard.cs
- Paragraph.cs
- XLinq.cs
- InheritedPropertyDescriptor.cs
- WebSysDescriptionAttribute.cs
- GeneralTransform3DTo2D.cs
- DiscreteKeyFrames.cs
- ApplicationException.cs
- TreeNode.cs