Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / ndp / fx / src / xsp / System / Web / UI / WebParts / WebPartTransformerCollection.cs / 1 / WebPartTransformerCollection.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 WebPartTransformerCollection : CollectionBase { private bool _readOnly; public bool IsReadOnly { get { return _readOnly; } } public WebPartTransformer this[int index] { get { return (WebPartTransformer) List[index]; } set { List[index] = value; } } public int Add(WebPartTransformer transformer) { return List.Add(transformer); } private void CheckReadOnly() { if (_readOnly) { throw new InvalidOperationException(SR.GetString(SR.WebPartTransformerCollection_ReadOnly)); } } public bool Contains(WebPartTransformer transformer) { return List.Contains(transformer); } public void CopyTo(WebPartTransformer[] array, int index) { List.CopyTo(array, index); } public int IndexOf(WebPartTransformer transformer) { return List.IndexOf(transformer); } public void Insert(int index, WebPartTransformer transformer) { List.Insert(index, transformer); } protected override void OnClear() { CheckReadOnly(); base.OnClear(); } protected override void OnInsert(int index, object value) { CheckReadOnly(); if (List.Count > 0) { throw new InvalidOperationException(SR.GetString(SR.WebPartTransformerCollection_NotEmpty)); } base.OnInsert(index, value); } protected override void OnRemove(int index, object value) { CheckReadOnly(); base.OnRemove(index, value); } protected override void OnSet(int index, object oldValue, object newValue) { CheckReadOnly(); base.OnSet(index, oldValue, newValue); } protected override void OnValidate(object value) { base.OnValidate(value); if (value == null) { throw new ArgumentNullException("value", SR.GetString(SR.Collection_CantAddNull)); } if (!(value is WebPartTransformer)) { throw new ArgumentException(SR.GetString(SR.Collection_InvalidType, "WebPartTransformer"), "value"); } } public void Remove(WebPartTransformer transformer) { List.Remove(transformer); } internal void SetReadOnly() { _readOnly = true; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //------------------------------------------------------------------------------ //// 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 WebPartTransformerCollection : CollectionBase { private bool _readOnly; public bool IsReadOnly { get { return _readOnly; } } public WebPartTransformer this[int index] { get { return (WebPartTransformer) List[index]; } set { List[index] = value; } } public int Add(WebPartTransformer transformer) { return List.Add(transformer); } private void CheckReadOnly() { if (_readOnly) { throw new InvalidOperationException(SR.GetString(SR.WebPartTransformerCollection_ReadOnly)); } } public bool Contains(WebPartTransformer transformer) { return List.Contains(transformer); } public void CopyTo(WebPartTransformer[] array, int index) { List.CopyTo(array, index); } public int IndexOf(WebPartTransformer transformer) { return List.IndexOf(transformer); } public void Insert(int index, WebPartTransformer transformer) { List.Insert(index, transformer); } protected override void OnClear() { CheckReadOnly(); base.OnClear(); } protected override void OnInsert(int index, object value) { CheckReadOnly(); if (List.Count > 0) { throw new InvalidOperationException(SR.GetString(SR.WebPartTransformerCollection_NotEmpty)); } base.OnInsert(index, value); } protected override void OnRemove(int index, object value) { CheckReadOnly(); base.OnRemove(index, value); } protected override void OnSet(int index, object oldValue, object newValue) { CheckReadOnly(); base.OnSet(index, oldValue, newValue); } protected override void OnValidate(object value) { base.OnValidate(value); if (value == null) { throw new ArgumentNullException("value", SR.GetString(SR.Collection_CantAddNull)); } if (!(value is WebPartTransformer)) { throw new ArgumentException(SR.GetString(SR.Collection_InvalidType, "WebPartTransformer"), "value"); } } public void Remove(WebPartTransformer transformer) { List.Remove(transformer); } internal void SetReadOnly() { _readOnly = true; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ArrayTypeMismatchException.cs
- FastPropertyAccessor.cs
- HwndPanningFeedback.cs
- IsolatedStoragePermission.cs
- DebugView.cs
- TypeReference.cs
- AsyncCompletedEventArgs.cs
- MobileControlsSectionHelper.cs
- DataGridViewColumnCollectionEditor.cs
- XmlAtomicValue.cs
- Line.cs
- TextEditorSelection.cs
- SessionSymmetricMessageSecurityProtocolFactory.cs
- FacetChecker.cs
- XmlDictionaryReaderQuotasElement.cs
- ObjectReaderCompiler.cs
- MessageHeaderDescriptionCollection.cs
- ThreadAttributes.cs
- CodeCatchClauseCollection.cs
- DummyDataSource.cs
- ContentElementAutomationPeer.cs
- SqlHelper.cs
- _ListenerRequestStream.cs
- SignerInfo.cs
- Table.cs
- OutputScope.cs
- TableRowCollection.cs
- ImageListImageEditor.cs
- WaitHandle.cs
- SmtpDigestAuthenticationModule.cs
- _BaseOverlappedAsyncResult.cs
- TextParagraphProperties.cs
- SourceFileBuildProvider.cs
- XmlSchemaDocumentation.cs
- configsystem.cs
- EntityDataSourceEntitySetNameItem.cs
- TextRunTypographyProperties.cs
- InvalidEnumArgumentException.cs
- ApplicationException.cs
- WebConfigurationFileMap.cs
- QilPatternFactory.cs
- XPathBuilder.cs
- ResourceIDHelper.cs
- DesignerVerbCollection.cs
- DrawingServices.cs
- LineServices.cs
- DataGridColumnHeader.cs
- VScrollBar.cs
- PresentationAppDomainManager.cs
- XmlSerializerAssemblyAttribute.cs
- CommandField.cs
- GatewayDefinition.cs
- XmlSignatureProperties.cs
- OleDbPermission.cs
- ItemContainerProviderWrapper.cs
- unsafenativemethodstextservices.cs
- CharAnimationUsingKeyFrames.cs
- DataBindingList.cs
- SoapHeaders.cs
- ValidationHelpers.cs
- PlatformNotSupportedException.cs
- QilPatternVisitor.cs
- XmlObjectSerializerWriteContextComplex.cs
- TrustSection.cs
- DesignTimeSiteMapProvider.cs
- SessionPageStateSection.cs
- HandledMouseEvent.cs
- Rotation3DAnimationUsingKeyFrames.cs
- MetabaseSettingsIis7.cs
- Types.cs
- ThicknessAnimationUsingKeyFrames.cs
- AdjustableArrowCap.cs
- CurrentChangedEventManager.cs
- XmlSchemaNotation.cs
- CodeConditionStatement.cs
- TextProperties.cs
- HeaderElement.cs
- AlphabeticalEnumConverter.cs
- XmlSignatureManifest.cs
- SecurityImpersonationBehavior.cs
- OleDragDropHandler.cs
- CacheMemory.cs
- CellIdBoolean.cs
- Accessible.cs
- Event.cs
- LongTypeConverter.cs
- FrameworkContentElement.cs
- HMACSHA512.cs
- ScopelessEnumAttribute.cs
- PenLineJoinValidation.cs
- DrawingCollection.cs
- DiagnosticsConfiguration.cs
- SQLBinaryStorage.cs
- DetailsViewPageEventArgs.cs
- DaylightTime.cs
- DayRenderEvent.cs
- PinnedBufferMemoryStream.cs
- FloaterParaClient.cs
- AssemblyHelper.cs
- ErrorsHelper.cs