Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / xsp / System / Web / UI / WebParts / WebPartDescriptionCollection.cs / 1 / WebPartDescriptionCollection.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.WebControls.WebParts { using System; using System.Collections; using System.Collections.Specialized; using System.ComponentModel; using System.Globalization; using System.Security.Permissions; [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] public sealed class WebPartDescriptionCollection : ReadOnlyCollectionBase { private HybridDictionary _ids; public WebPartDescriptionCollection() { } public WebPartDescriptionCollection(ICollection webPartDescriptions) { if (webPartDescriptions == null) { throw new ArgumentNullException("webPartDescriptions"); } _ids = new HybridDictionary(webPartDescriptions.Count, true /* caseInsensitive */); foreach (object obj in webPartDescriptions) { if (obj == null) { throw new ArgumentException(SR.GetString(SR.Collection_CantAddNull), "webPartDescriptions"); } WebPartDescription description = obj as WebPartDescription; if (description == null) { throw new ArgumentException(SR.GetString(SR.Collection_InvalidType, "WebPartDescription"), "webPartDescriptions"); } string id = description.ID; if (!_ids.Contains(id)) { InnerList.Add(description); _ids.Add(id, description); } else { throw new ArgumentException(SR.GetString( SR.WebPart_Collection_DuplicateID, "WebPartDescription", id), "webPartDescriptions"); } } } public bool Contains(WebPartDescription value) { return InnerList.Contains(value); } public int IndexOf(WebPartDescription value) { return InnerList.IndexOf(value); } public WebPartDescription this[int index] { get { return (WebPartDescription) InnerList[index]; } } public WebPartDescription this[string id] { get { return ((_ids != null) ? (WebPartDescription)_ids[id] : null); } } public void CopyTo(WebPartDescription[] array, int index) { InnerList.CopyTo(array, index); } } } // 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.Collections.Specialized; using System.ComponentModel; using System.Globalization; using System.Security.Permissions; [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] public sealed class WebPartDescriptionCollection : ReadOnlyCollectionBase { private HybridDictionary _ids; public WebPartDescriptionCollection() { } public WebPartDescriptionCollection(ICollection webPartDescriptions) { if (webPartDescriptions == null) { throw new ArgumentNullException("webPartDescriptions"); } _ids = new HybridDictionary(webPartDescriptions.Count, true /* caseInsensitive */); foreach (object obj in webPartDescriptions) { if (obj == null) { throw new ArgumentException(SR.GetString(SR.Collection_CantAddNull), "webPartDescriptions"); } WebPartDescription description = obj as WebPartDescription; if (description == null) { throw new ArgumentException(SR.GetString(SR.Collection_InvalidType, "WebPartDescription"), "webPartDescriptions"); } string id = description.ID; if (!_ids.Contains(id)) { InnerList.Add(description); _ids.Add(id, description); } else { throw new ArgumentException(SR.GetString( SR.WebPart_Collection_DuplicateID, "WebPartDescription", id), "webPartDescriptions"); } } } public bool Contains(WebPartDescription value) { return InnerList.Contains(value); } public int IndexOf(WebPartDescription value) { return InnerList.IndexOf(value); } public WebPartDescription this[int index] { get { return (WebPartDescription) InnerList[index]; } } public WebPartDescription this[string id] { get { return ((_ids != null) ? (WebPartDescription)_ids[id] : null); } } public void CopyTo(WebPartDescription[] array, int index) { InnerList.CopyTo(array, index); } } } // 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
- OdbcEnvironment.cs
- XmlNamespaceManager.cs
- SchemeSettingElementCollection.cs
- ImageListDesigner.cs
- Input.cs
- CodeTypeMember.cs
- bindurihelper.cs
- ViewStateException.cs
- ProgressBarRenderer.cs
- RequestQueryParser.cs
- GlyphingCache.cs
- ProviderBase.cs
- TrackPointCollection.cs
- ConnectionInterfaceCollection.cs
- SqlMethodCallConverter.cs
- EntityDataSourceReferenceGroup.cs
- PageScaling.cs
- DbException.cs
- TriggerBase.cs
- SystemColors.cs
- QueryAccessibilityHelpEvent.cs
- Utility.cs
- RequiredArgumentAttribute.cs
- TraceListeners.cs
- MenuBase.cs
- XmlNodeComparer.cs
- SocketElement.cs
- ItemContainerGenerator.cs
- FramingDecoders.cs
- HealthMonitoringSection.cs
- KnowledgeBase.cs
- DynamicMethod.cs
- TextContainerHelper.cs
- SerializationFieldInfo.cs
- GeneralTransform2DTo3DTo2D.cs
- FormParameter.cs
- XmlEntity.cs
- OrderedDictionaryStateHelper.cs
- PropertySet.cs
- contentDescriptor.cs
- SymbolPair.cs
- ValidatedControlConverter.cs
- _ProxyRegBlob.cs
- HMACSHA384.cs
- Int64AnimationBase.cs
- ApplicationHost.cs
- OleCmdHelper.cs
- SqlReferenceCollection.cs
- VerticalAlignConverter.cs
- RotateTransform.cs
- BuildManagerHost.cs
- UriParserTemplates.cs
- SkinIDTypeConverter.cs
- Border.cs
- TransactionState.cs
- SafeEventLogReadHandle.cs
- NativeMethods.cs
- WebPartDisplayModeCancelEventArgs.cs
- WebPartCloseVerb.cs
- OuterProxyWrapper.cs
- MatrixTransform3D.cs
- ProfileSettingsCollection.cs
- BaseProcessor.cs
- ProcessModelInfo.cs
- AppSettingsReader.cs
- PrimaryKeyTypeConverter.cs
- InstanceOwnerQueryResult.cs
- _AutoWebProxyScriptWrapper.cs
- XPathAncestorIterator.cs
- CodeDelegateCreateExpression.cs
- TextFormatterContext.cs
- EntityException.cs
- ReflectTypeDescriptionProvider.cs
- StreamReader.cs
- WebPartConnection.cs
- MouseButtonEventArgs.cs
- ResolveMatchesMessage11.cs
- Mapping.cs
- MenuCommandsChangedEventArgs.cs
- EntityTypeEmitter.cs
- FixedTextPointer.cs
- ISSmlParser.cs
- InternalDispatchObject.cs
- TextServicesCompartmentEventSink.cs
- StringUtil.cs
- DataControlFieldCell.cs
- QilExpression.cs
- HMACSHA256.cs
- OrderedDictionaryStateHelper.cs
- InternalConfigSettingsFactory.cs
- EventDriven.cs
- MasterPage.cs
- SettingsAttributeDictionary.cs
- _CommandStream.cs
- Stack.cs
- TdsParserStaticMethods.cs
- CodeMemberField.cs
- WindowProviderWrapper.cs
- ManagementQuery.cs
- ResolveDuplexCD1AsyncResult.cs