Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / 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; } } }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- EventHandlerService.cs
- ComboBox.cs
- Mapping.cs
- SHA384Managed.cs
- xmlsaver.cs
- XsdValidatingReader.cs
- SystemIPv6InterfaceProperties.cs
- Int32AnimationUsingKeyFrames.cs
- _FtpDataStream.cs
- RelationshipManager.cs
- TextEditorSpelling.cs
- DataControlHelper.cs
- CodeMethodInvokeExpression.cs
- WindowsToolbar.cs
- DetectEofStream.cs
- RadioButtonBaseAdapter.cs
- PreviewControlDesigner.cs
- KoreanLunisolarCalendar.cs
- QilFunction.cs
- WebPartDisplayModeCollection.cs
- FieldDescriptor.cs
- SqlDataSourceSelectingEventArgs.cs
- DefinitionBase.cs
- InboundActivityHelper.cs
- DoubleStorage.cs
- DateRangeEvent.cs
- ArcSegment.cs
- SortDescription.cs
- Message.cs
- SpecularMaterial.cs
- _CacheStreams.cs
- ControlBuilder.cs
- EntityDataSourceContextDisposingEventArgs.cs
- SrgsElementList.cs
- DbConnectionInternal.cs
- ProcessRequestArgs.cs
- PathStreamGeometryContext.cs
- WebPageTraceListener.cs
- OpacityConverter.cs
- SHA512Cng.cs
- InternalPermissions.cs
- IndexedGlyphRun.cs
- PtsPage.cs
- XmlTextWriter.cs
- SafeFileMappingHandle.cs
- QueryCreatedEventArgs.cs
- ConstrainedGroup.cs
- RemotingHelper.cs
- XmlSchemaSimpleContentExtension.cs
- WindowsListViewItemCheckBox.cs
- XmlElementAttribute.cs
- ImageCodecInfoPrivate.cs
- OnOperation.cs
- Int32Storage.cs
- CalendarDay.cs
- AttachmentCollection.cs
- ValidationVisibilityAttribute.cs
- NotSupportedException.cs
- CompositeFontFamily.cs
- UserThread.cs
- CookielessHelper.cs
- WebHeaderCollection.cs
- MatrixValueSerializer.cs
- EntityDataSourceUtil.cs
- TreePrinter.cs
- XPathBinder.cs
- XmlSchemaAll.cs
- SafeHandles.cs
- MatrixTransform3D.cs
- XmlValidatingReader.cs
- UpdatePanel.cs
- GeneralTransform3D.cs
- _ServiceNameStore.cs
- LineServices.cs
- OciLobLocator.cs
- MessageBox.cs
- Utils.cs
- ParentQuery.cs
- _IPv4Address.cs
- HTMLTextWriter.cs
- WinEventHandler.cs
- DataTableReader.cs
- CngKeyBlobFormat.cs
- FrameworkElement.cs
- ApplicationInterop.cs
- QueryStack.cs
- RewritingPass.cs
- DisplayNameAttribute.cs
- StylusShape.cs
- FileStream.cs
- WorkflowQueuingService.cs
- NewItemsContextMenuStrip.cs
- HandlerBase.cs
- ClassDataContract.cs
- WebPartZoneCollection.cs
- TreeIterators.cs
- documentsequencetextview.cs
- LinkClickEvent.cs
- FixUpCollection.cs
- _IPv6Address.cs