Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / ndp / fx / src / xsp / System / Web / UI / WebParts / EditorPartCollection.cs / 1 / EditorPartCollection.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Web.UI.WebControls.WebParts {
using System;
using System.Collections;
using System.Security.Permissions;
[AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)]
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
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.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Web.UI.WebControls.WebParts {
using System;
using System.Collections;
using System.Security.Permissions;
[AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)]
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
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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- PasswordBox.cs
- MarginCollapsingState.cs
- ScriptingAuthenticationServiceSection.cs
- TrackingParameters.cs
- MenuCommandsChangedEventArgs.cs
- CopyCodeAction.cs
- VerificationException.cs
- QilPatternFactory.cs
- VisualStateManager.cs
- BufferBuilder.cs
- CommandHelper.cs
- Drawing.cs
- ReliabilityContractAttribute.cs
- Win32.cs
- ToolStripGrip.cs
- SerializationObjectManager.cs
- Evaluator.cs
- CommandManager.cs
- ContractSearchPattern.cs
- Wow64ConfigurationLoader.cs
- XamlReaderConstants.cs
- Condition.cs
- XmlAttribute.cs
- DefinitionUpdate.cs
- util.cs
- WinInet.cs
- StateManager.cs
- HttpRuntimeSection.cs
- IriParsingElement.cs
- DecimalAnimationUsingKeyFrames.cs
- FormViewUpdateEventArgs.cs
- DbProviderConfigurationHandler.cs
- MessageDroppedTraceRecord.cs
- SqlMetaData.cs
- WmfPlaceableFileHeader.cs
- HashCodeCombiner.cs
- Models.cs
- WinInetCache.cs
- DragDropHelper.cs
- SqlCachedBuffer.cs
- MimeBasePart.cs
- HttpSocketManager.cs
- EmptyStringExpandableObjectConverter.cs
- RecordConverter.cs
- Group.cs
- InputDevice.cs
- WindowsListView.cs
- Baml2006KnownTypes.cs
- DiagnosticTraceRecords.cs
- OleDbConnectionFactory.cs
- TextTreeFixupNode.cs
- PagerSettings.cs
- SamlAction.cs
- CustomCredentialPolicy.cs
- PageHandlerFactory.cs
- Style.cs
- SurrogateSelector.cs
- CellParaClient.cs
- DbSourceParameterCollection.cs
- Brushes.cs
- TextServicesContext.cs
- HttpListenerRequest.cs
- _Rfc2616CacheValidators.cs
- EncryptedType.cs
- LiteralText.cs
- WindowsTab.cs
- ContentPlaceHolder.cs
- RelatedImageListAttribute.cs
- LingerOption.cs
- UIElement.cs
- WSDualHttpBinding.cs
- DataGridBoolColumn.cs
- ValidatingReaderNodeData.cs
- Errors.cs
- SystemColors.cs
- Method.cs
- TextBlockAutomationPeer.cs
- MaskedTextProvider.cs
- InvalidOleVariantTypeException.cs
- BoundPropertyEntry.cs
- HtmlInputCheckBox.cs
- TrustSection.cs
- _SslStream.cs
- CachedFontFamily.cs
- StreamHelper.cs
- ComponentRenameEvent.cs
- ActiveDocumentEvent.cs
- ItemCheckedEvent.cs
- EntryWrittenEventArgs.cs
- DeviceSpecificDesigner.cs
- ArrayTypeMismatchException.cs
- PasswordTextNavigator.cs
- ArraySegment.cs
- IndexedString.cs
- SoapFormatterSinks.cs
- Visual3D.cs
- MeasureData.cs
- IteratorFilter.cs
- CallTemplateAction.cs
- QuadraticEase.cs