Code:
/ FX-1434 / FX-1434 / 1.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
- CoTaskMemHandle.cs
- NumericUpDownAccelerationCollection.cs
- IDispatchConstantAttribute.cs
- StructuredType.cs
- ColorConvertedBitmapExtension.cs
- WorkflowViewManager.cs
- QuaternionRotation3D.cs
- ItemsPanelTemplate.cs
- MetadataArtifactLoaderCompositeFile.cs
- WhereaboutsReader.cs
- Polygon.cs
- CheckBoxFlatAdapter.cs
- PerformanceCounterPermissionEntryCollection.cs
- TransformPattern.cs
- NullableBoolConverter.cs
- CustomError.cs
- UnsafeMethods.cs
- SimpleHandlerFactory.cs
- SchemaImporter.cs
- PersonalizationProviderHelper.cs
- FamilyTypefaceCollection.cs
- DataControlCommands.cs
- XmlSchemaElement.cs
- WorkflowServiceNamespace.cs
- FontWeights.cs
- TransformValueSerializer.cs
- PerformanceCounterManager.cs
- DeferredSelectedIndexReference.cs
- Adorner.cs
- PolyQuadraticBezierSegment.cs
- FloatSumAggregationOperator.cs
- AsyncCompletedEventArgs.cs
- DtrList.cs
- SHA1Managed.cs
- DataTableClearEvent.cs
- BaseDataList.cs
- SmiEventStream.cs
- LocationReferenceValue.cs
- ConnectionProviderAttribute.cs
- documentsequencetextcontainer.cs
- BinaryCommonClasses.cs
- KeysConverter.cs
- ChainOfDependencies.cs
- XmlDomTextWriter.cs
- ToolStripHighContrastRenderer.cs
- BamlVersionHeader.cs
- LinqDataSource.cs
- WorkflowMarkupSerializationManager.cs
- ResourceExpression.cs
- UserPreferenceChangingEventArgs.cs
- PositiveTimeSpanValidatorAttribute.cs
- DesignTimeParseData.cs
- _DynamicWinsockMethods.cs
- WebPartZone.cs
- PropertyTab.cs
- ColorConverter.cs
- GeometryConverter.cs
- CheckBoxFlatAdapter.cs
- ISessionStateStore.cs
- StagingAreaInputItem.cs
- ProfilePropertySettings.cs
- TypeBuilderInstantiation.cs
- NonParentingControl.cs
- ToolStripLocationCancelEventArgs.cs
- DesignerVerb.cs
- XsltLibrary.cs
- AccessDataSourceDesigner.cs
- DnsPermission.cs
- TokenBasedSet.cs
- UrlPath.cs
- HttpListenerException.cs
- EnumUnknown.cs
- MailBnfHelper.cs
- ValidationPropertyAttribute.cs
- ExpressionEditorAttribute.cs
- RichTextBox.cs
- FullTextState.cs
- Int32Converter.cs
- ContainerUIElement3D.cs
- MaskedTextBox.cs
- FlowStep.cs
- SynchronizationLockException.cs
- StringFormat.cs
- CombinedGeometry.cs
- MSAAEventDispatcher.cs
- ForEachDesigner.xaml.cs
- GeometryHitTestResult.cs
- DateTimeFormatInfoScanner.cs
- ObservableCollection.cs
- ResourceDescriptionAttribute.cs
- CodePageUtils.cs
- MSAANativeProvider.cs
- Rect.cs
- DictionaryChange.cs
- StreamWriter.cs
- CodeCatchClauseCollection.cs
- FrugalMap.cs
- SQLByteStorage.cs
- FontNameEditor.cs
- DependencyPropertyAttribute.cs