You've already forked linux-packaging-mono
Imported Upstream version 4.6.0.125
Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
This commit is contained in:
parent
a569aebcfd
commit
e79aa3c0ed
@ -0,0 +1,78 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <copyright file="WebPartZoneCollection.cs" company="Microsoft">
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// </copyright>
|
||||
//------------------------------------------------------------------------------
|
||||
namespace System.Web.UI.WebControls.WebParts {
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Globalization;
|
||||
|
||||
/// <devdoc>
|
||||
/// Read-only collection of WebPartZones. Collection cannot be modified after contstruction.
|
||||
/// </devdoc>
|
||||
public sealed class WebPartZoneCollection : ReadOnlyCollectionBase {
|
||||
|
||||
public WebPartZoneCollection() {
|
||||
}
|
||||
|
||||
public WebPartZoneCollection(ICollection webPartZones) {
|
||||
if (webPartZones == null) {
|
||||
throw new ArgumentNullException("webPartZones");
|
||||
}
|
||||
|
||||
foreach (object obj in webPartZones) {
|
||||
if (obj == null) {
|
||||
throw new ArgumentException(SR.GetString(SR.Collection_CantAddNull), "webPartZones");
|
||||
}
|
||||
if (!(obj is WebPartZone)) {
|
||||
throw new ArgumentException(SR.GetString(SR.Collection_InvalidType, "WebPartZone"), "webPartZones");
|
||||
}
|
||||
InnerList.Add(obj);
|
||||
}
|
||||
}
|
||||
|
||||
internal int Add(WebPartZoneBase value) {
|
||||
return InnerList.Add(value);
|
||||
}
|
||||
|
||||
public bool Contains(WebPartZoneBase value) {
|
||||
return InnerList.Contains(value);
|
||||
}
|
||||
|
||||
public int IndexOf(WebPartZoneBase value) {
|
||||
return InnerList.IndexOf(value);
|
||||
}
|
||||
|
||||
public WebPartZoneBase this[int index] {
|
||||
get {
|
||||
return (WebPartZoneBase) InnerList[index];
|
||||
}
|
||||
}
|
||||
|
||||
public WebPartZoneBase this[string id] {
|
||||
get {
|
||||
WebPartZoneBase selectedZone = null;
|
||||
|
||||
foreach (WebPartZoneBase zone in InnerList) {
|
||||
if (String.Equals(zone.ID, id, StringComparison.OrdinalIgnoreCase)) {
|
||||
selectedZone = zone;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return selectedZone;
|
||||
}
|
||||
}
|
||||
|
||||
/// <devdoc>
|
||||
/// <para>Copies contents from the collection to a specified array with a
|
||||
/// specified starting index.</para>
|
||||
/// </devdoc>
|
||||
public void CopyTo(WebPartZoneBase[] array, int index) {
|
||||
InnerList.CopyTo(array, index);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user