Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / xsp / System / Web / UI / WebParts / TransformerTypeCollection.cs / 1 / TransformerTypeCollection.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.WebControls.WebParts { using System; using System.Collections; using System.ComponentModel; using System.Security.Permissions; [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] public sealed class TransformerTypeCollection : ReadOnlyCollectionBase { public static readonly TransformerTypeCollection Empty = new TransformerTypeCollection(); public TransformerTypeCollection() { } public TransformerTypeCollection(ICollection transformerTypes) { Initialize(null, transformerTypes); } public TransformerTypeCollection(TransformerTypeCollection existingTransformerTypes, ICollection transformerTypes) { Initialize(existingTransformerTypes, transformerTypes); } internal int Add(Type value) { if (!value.IsSubclassOf(typeof(WebPartTransformer))) { throw new InvalidOperationException(SR.GetString(SR.WebPartTransformerAttribute_NotTransformer, value.Name)); } return InnerList.Add(value); } private void Initialize(TransformerTypeCollection existingTransformerTypes, ICollection transformerTypes) { if (existingTransformerTypes != null) { foreach (Type existingTransformerType in existingTransformerTypes) { // Don't need to check arg, since we know it is valid since it came // from a TransformerTypeCollection. InnerList.Add(existingTransformerType); } } if (transformerTypes != null) { foreach (object obj in transformerTypes) { if (obj == null) { throw new ArgumentException(SR.GetString(SR.Collection_CantAddNull), "transformerTypes"); } if (!(obj is Type)) { throw new ArgumentException(SR.GetString(SR.Collection_InvalidType, "Type"), "transformerTypes"); } if (!((Type)obj).IsSubclassOf(typeof(WebPartTransformer))) { throw new ArgumentException(SR.GetString(SR.WebPartTransformerAttribute_NotTransformer, ((Type)obj).Name), "transformerTypes"); } InnerList.Add(obj); } } } public bool Contains(Type value) { return InnerList.Contains(value); } public int IndexOf(Type value) { return InnerList.IndexOf(value); } public Type this[int index] { get { return (Type)InnerList[index]; } } public void CopyTo(Type[] array, int index) { InnerList.CopyTo(array, index); } } }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- PriorityBinding.cs
- ProxyBuilder.cs
- WebPartDisplayModeEventArgs.cs
- IndexedString.cs
- QilInvokeEarlyBound.cs
- DesignTimeData.cs
- Tuple.cs
- XPathNodeList.cs
- RankException.cs
- StateMachineSubscription.cs
- ObjectDataSourceMethodEventArgs.cs
- XmlUTF8TextReader.cs
- XsdBuilder.cs
- Utility.cs
- ViewDesigner.cs
- SmiEventSink.cs
- LinearKeyFrames.cs
- PolyLineSegment.cs
- FormViewDeleteEventArgs.cs
- ColorConvertedBitmapExtension.cs
- CacheMemory.cs
- ArrayList.cs
- ToolStripComboBox.cs
- StackSpiller.Temps.cs
- SystemInformation.cs
- TcpTransportSecurity.cs
- NamespaceMapping.cs
- HTMLTagNameToTypeMapper.cs
- EventHandlersStore.cs
- WorkerRequest.cs
- Exception.cs
- EntityDesignerBuildProvider.cs
- SafeUserTokenHandle.cs
- GcHandle.cs
- AppDomainInfo.cs
- WindowsGrip.cs
- SafeSecurityHelper.cs
- ByteAnimationUsingKeyFrames.cs
- ScriptHandlerFactory.cs
- DataIdProcessor.cs
- ValueTypeFixupInfo.cs
- QilPatternVisitor.cs
- Module.cs
- UnsafeNativeMethodsCLR.cs
- MemberHolder.cs
- ZoneIdentityPermission.cs
- Base64Encoder.cs
- SqlCacheDependencyDatabase.cs
- EncodingInfo.cs
- BuilderInfo.cs
- WizardPanelChangingEventArgs.cs
- XmlObjectSerializerWriteContext.cs
- XmlDataSource.cs
- HyperLinkStyle.cs
- WindowExtensionMethods.cs
- ChangeNode.cs
- DesignerAdapterAttribute.cs
- NullRuntimeConfig.cs
- ProfileInfo.cs
- WmlCalendarAdapter.cs
- PropertyDescriptorComparer.cs
- TypeUtil.cs
- MailFileEditor.cs
- TextProviderWrapper.cs
- LocalizableResourceBuilder.cs
- AvTraceFormat.cs
- GlyphingCache.cs
- DetailsViewAutoFormat.cs
- SamlConditions.cs
- DbBuffer.cs
- MsmqIntegrationMessagePool.cs
- __Filters.cs
- DnsPermission.cs
- LockedBorderGlyph.cs
- _IPv4Address.cs
- UnknownBitmapDecoder.cs
- RepeaterCommandEventArgs.cs
- COM2ExtendedBrowsingHandler.cs
- EnvironmentPermission.cs
- InkCanvasAutomationPeer.cs
- XmlDataContract.cs
- UnsafeNativeMethods.cs
- StretchValidation.cs
- TransactionFlowAttribute.cs
- AccessDataSource.cs
- PageClientProxyGenerator.cs
- WebPartEditorOkVerb.cs
- AnnotationAdorner.cs
- GeometryValueSerializer.cs
- PenLineCapValidation.cs
- PenThreadWorker.cs
- XmlSecureResolver.cs
- NetworkInformationPermission.cs
- ObjectQuery.cs
- ActivityDesignerHighlighter.cs
- Vector3dCollection.cs
- WebPartVerb.cs
- CollectionViewProxy.cs
- ApplicationId.cs
- InputProcessorProfiles.cs