Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / UI / WebParts / WebPartTransformerCollection.cs / 1305376 / WebPartTransformerCollection.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.WebControls.WebParts { using System; using System.Collections; 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DataRecord.cs
- MetadataUtilsSmi.cs
- ComboBox.cs
- TableStyle.cs
- MarkupProperty.cs
- XhtmlBasicPhoneCallAdapter.cs
- SecurityContext.cs
- TextEffectCollection.cs
- DrawingState.cs
- ProxyWebPartManager.cs
- Environment.cs
- TypeDependencyAttribute.cs
- MethodBuilder.cs
- ConfigurationLocationCollection.cs
- LoginCancelEventArgs.cs
- MSAAWinEventWrap.cs
- SQLBinary.cs
- ClientFormsAuthenticationMembershipProvider.cs
- CheckBoxBaseAdapter.cs
- DataGridColumn.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- WindowsTooltip.cs
- ChtmlPageAdapter.cs
- DataBinding.cs
- ImageCodecInfo.cs
- MergePropertyDescriptor.cs
- AmbiguousMatchException.cs
- CustomWebEventKey.cs
- ResourceCategoryAttribute.cs
- AliasedSlot.cs
- VideoDrawing.cs
- DesignerMetadata.cs
- PersonalizablePropertyEntry.cs
- EntityDataSourceMemberPath.cs
- ViewKeyConstraint.cs
- MemberCollection.cs
- EpmContentDeSerializerBase.cs
- SymbolDocumentInfo.cs
- PlatformNotSupportedException.cs
- DeviceSpecificDialogCachedState.cs
- ArrayWithOffset.cs
- KeyFrames.cs
- RNGCryptoServiceProvider.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- X509UI.cs
- DataGridViewCellCancelEventArgs.cs
- PropertyTabAttribute.cs
- activationcontext.cs
- RouteParser.cs
- TraceProvider.cs
- QilXmlWriter.cs
- TextSchema.cs
- SelectionItemPatternIdentifiers.cs
- ReceiveContext.cs
- IntPtr.cs
- Selector.cs
- ActiveXHelper.cs
- EditorResources.cs
- SqlClientWrapperSmiStream.cs
- FrameworkTextComposition.cs
- Menu.cs
- OdbcConnectionFactory.cs
- StrokeNodeOperations.cs
- AccessViolationException.cs
- NegationPusher.cs
- ComNativeDescriptor.cs
- StylusDownEventArgs.cs
- DateTimeFormat.cs
- DocumentCollection.cs
- DataObjectPastingEventArgs.cs
- PathBox.cs
- HttpHandlerActionCollection.cs
- ObsoleteAttribute.cs
- Baml6Assembly.cs
- Switch.cs
- InheritanceContextHelper.cs
- MobilePage.cs
- Floater.cs
- ColorKeyFrameCollection.cs
- controlskin.cs
- HttpStreamXmlDictionaryReader.cs
- ColumnWidthChangingEvent.cs
- NetworkStream.cs
- InvokeMethod.cs
- UriSectionData.cs
- ListViewItem.cs
- SqlFactory.cs
- _Events.cs
- ContentWrapperAttribute.cs
- Assembly.cs
- GZipDecoder.cs
- TypeReference.cs
- ValueUnavailableException.cs
- DurableTimerExtension.cs
- WindowsHyperlink.cs
- ByteAnimationBase.cs
- validationstate.cs
- HierarchicalDataBoundControlAdapter.cs
- FontFaceLayoutInfo.cs
- TextMetrics.cs