Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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 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;
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 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
- ResourceProviderFactory.cs
- RequestCache.cs
- EntityTypeBase.cs
- ComponentDesigner.cs
- RuleSettings.cs
- KeyboardNavigation.cs
- MemoryRecordBuffer.cs
- TextBoxLine.cs
- UnsafeNativeMethods.cs
- HandlerMappingMemo.cs
- EntityAdapter.cs
- CornerRadiusConverter.cs
- ColumnCollectionEditor.cs
- MasterPageCodeDomTreeGenerator.cs
- ClientType.cs
- ToolboxComponentsCreatedEventArgs.cs
- XsltContext.cs
- _BasicClient.cs
- GenericTypeParameterConverter.cs
- tibetanshape.cs
- _UncName.cs
- DesignerAttribute.cs
- BroadcastEventHelper.cs
- Positioning.cs
- TabOrder.cs
- DictionaryEntry.cs
- LoginCancelEventArgs.cs
- MultiSelector.cs
- ViewValidator.cs
- BuilderPropertyEntry.cs
- TraceLevelHelper.cs
- ExternalException.cs
- DecoderBestFitFallback.cs
- DocumentSequenceHighlightLayer.cs
- GridViewCancelEditEventArgs.cs
- ValidatingPropertiesEventArgs.cs
- UnmanagedHandle.cs
- SiteMapNodeItem.cs
- PointConverter.cs
- RayMeshGeometry3DHitTestResult.cs
- WebRequestModuleElement.cs
- TablePattern.cs
- DataViewSettingCollection.cs
- SqlXmlStorage.cs
- CodeTypeMemberCollection.cs
- ListItem.cs
- TextContainerChangeEventArgs.cs
- WebPartDescription.cs
- HttpCachePolicy.cs
- WebPartZone.cs
- RefreshPropertiesAttribute.cs
- QuestionEventArgs.cs
- DocumentSchemaValidator.cs
- EditorZoneBase.cs
- MouseEvent.cs
- RegistryPermission.cs
- AppearanceEditorPart.cs
- OpenTypeLayout.cs
- PngBitmapDecoder.cs
- TraceEventCache.cs
- SamlSecurityTokenAuthenticator.cs
- TdsParameterSetter.cs
- HitTestWithPointDrawingContextWalker.cs
- SafeMarshalContext.cs
- ObjectDataSourceEventArgs.cs
- TimestampInformation.cs
- SortAction.cs
- SystemNetworkInterface.cs
- EncodingInfo.cs
- ObjectStateFormatter.cs
- CompositeFontParser.cs
- WebConfigurationFileMap.cs
- TemplateModeChangedEventArgs.cs
- DataGridViewCellPaintingEventArgs.cs
- ChangeProcessor.cs
- SiteMapNode.cs
- ButtonFieldBase.cs
- FileResponseElement.cs
- GPRECTF.cs
- EventHandlingScope.cs
- WindowsListViewScroll.cs
- ProfileGroupSettingsCollection.cs
- AppSecurityManager.cs
- EdmItemCollection.OcAssemblyCache.cs
- InfoCardProofToken.cs
- XmlWhitespace.cs
- FunctionDetailsReader.cs
- XmlSchemaSet.cs
- FileSystemInfo.cs
- Point3DValueSerializer.cs
- SqlGenericUtil.cs
- XamlDesignerSerializationManager.cs
- ClientType.cs
- PnrpPermission.cs
- ProviderConnectionPointCollection.cs
- SqlGenericUtil.cs
- Operators.cs
- CodeNamespaceImport.cs
- WriteFileContext.cs
- WinCategoryAttribute.cs