Code:
/ 4.0 / 4.0 / 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. //------------------------------------------------------------------------------ //// 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
- RelationshipConstraintValidator.cs
- LineGeometry.cs
- httpapplicationstate.cs
- IIS7UserPrincipal.cs
- ActivityTypeCodeDomSerializer.cs
- EntityDataSource.cs
- DataGridHeaderBorder.cs
- DataGridViewCellStateChangedEventArgs.cs
- InstanceKey.cs
- SimpleType.cs
- XmlDeclaration.cs
- MatcherBuilder.cs
- BufferedStream.cs
- EmptyElement.cs
- HybridDictionary.cs
- IISMapPath.cs
- DataGridHeaderBorder.cs
- EastAsianLunisolarCalendar.cs
- ObjectViewEntityCollectionData.cs
- HashStream.cs
- ExpressionVisitorHelpers.cs
- LocalizableResourceBuilder.cs
- GcSettings.cs
- RenderCapability.cs
- ToolbarAUtomationPeer.cs
- MatrixConverter.cs
- XmlWrappingReader.cs
- RayMeshGeometry3DHitTestResult.cs
- XmlDataSourceView.cs
- SqlNotificationEventArgs.cs
- UnitySerializationHolder.cs
- NotifyParentPropertyAttribute.cs
- Normalization.cs
- Int32AnimationBase.cs
- Graphics.cs
- FlowDecision.cs
- ReflectionPermission.cs
- HostingEnvironment.cs
- CodeArrayIndexerExpression.cs
- OdbcConnectionPoolProviderInfo.cs
- log.cs
- FrameworkContentElementAutomationPeer.cs
- Listbox.cs
- metadatamappinghashervisitor.hashsourcebuilder.cs
- Serializer.cs
- ObjectStateEntryDbDataRecord.cs
- SystemIPInterfaceStatistics.cs
- TypeToken.cs
- GenericAuthenticationEventArgs.cs
- InvalidEnumArgumentException.cs
- PlatformCulture.cs
- GroupBox.cs
- DataGridColumn.cs
- TextFindEngine.cs
- AsyncCompletedEventArgs.cs
- _NegoState.cs
- MimeFormatter.cs
- DataGridItemCollection.cs
- WrapPanel.cs
- DynamicDocumentPaginator.cs
- DataBinder.cs
- RegistryKey.cs
- VirtualizedItemProviderWrapper.cs
- MergeFilterQuery.cs
- X509CertificateRecipientClientCredential.cs
- HtmlSelect.cs
- CalendarTable.cs
- MemoryRecordBuffer.cs
- ByteStreamGeometryContext.cs
- FormatException.cs
- ClientSettings.cs
- MenuRenderer.cs
- ConfigsHelper.cs
- SocketAddress.cs
- CacheMemory.cs
- TransformGroup.cs
- XXXInfos.cs
- RegexCompiler.cs
- ProfessionalColorTable.cs
- TreeViewItemAutomationPeer.cs
- DesignerActionHeaderItem.cs
- FilterException.cs
- CompletionBookmark.cs
- InstanceOwner.cs
- GB18030Encoding.cs
- IISMapPath.cs
- GraphicsState.cs
- DirectionalLight.cs
- TrackBar.cs
- BoundingRectTracker.cs
- QueryCacheManager.cs
- ExpressionEditorAttribute.cs
- FixedSOMTextRun.cs
- WebPartCloseVerb.cs
- ThreadNeutralSemaphore.cs
- DiscoveryEndpointValidator.cs
- EncryptedType.cs
- FtpCachePolicyElement.cs
- Latin1Encoding.cs
- WarningException.cs