Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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. // //----------------------------------------------------------------------------- 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- PointLight.cs
- InvalidCastException.cs
- ProviderSettings.cs
- BitmapEffectGroup.cs
- AuthenticationServiceManager.cs
- FlowDocument.cs
- HandlerFactoryWrapper.cs
- ProviderCollection.cs
- Menu.cs
- ListMarkerLine.cs
- ParentQuery.cs
- NativeMsmqMessage.cs
- RegexStringValidator.cs
- EditorPartCollection.cs
- OleDbStruct.cs
- SourceLineInfo.cs
- BaseConfigurationRecord.cs
- AutoSizeComboBox.cs
- _DisconnectOverlappedAsyncResult.cs
- KerberosRequestorSecurityToken.cs
- DependencyObject.cs
- UriWriter.cs
- BooleanAnimationBase.cs
- MouseCaptureWithinProperty.cs
- LineServices.cs
- IntersectQueryOperator.cs
- MessageVersion.cs
- SecurityContext.cs
- EventLogger.cs
- QueryExecutionOption.cs
- SQLInt64.cs
- Simplifier.cs
- TextCharacters.cs
- TypeSystem.cs
- ChannelParameterCollection.cs
- JsonDeserializer.cs
- HostVisual.cs
- DataSet.cs
- CompilationSection.cs
- SecurityUtils.cs
- InstancePersistenceContext.cs
- FixedSOMTextRun.cs
- SecondaryViewProvider.cs
- Tool.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- ArrayExtension.cs
- Logging.cs
- InstanceData.cs
- Point3DCollectionConverter.cs
- NotificationContext.cs
- _SSPISessionCache.cs
- SQLInt16.cs
- TypeListConverter.cs
- VisualStates.cs
- TableLayout.cs
- AsymmetricSignatureDeformatter.cs
- AdCreatedEventArgs.cs
- XmlUtil.cs
- Literal.cs
- ReversePositionQuery.cs
- PointHitTestParameters.cs
- StatusInfoItem.cs
- JpegBitmapEncoder.cs
- XmlILConstructAnalyzer.cs
- ReflectionUtil.cs
- ConfigurationValues.cs
- TiffBitmapDecoder.cs
- WebBrowserSiteBase.cs
- BufferModesCollection.cs
- DbgCompiler.cs
- RecommendedAsConfigurableAttribute.cs
- ServerValidateEventArgs.cs
- OracleInfoMessageEventArgs.cs
- SecurityTokenSerializer.cs
- IncomingWebResponseContext.cs
- ListBox.cs
- RightNameExpirationInfoPair.cs
- RtfToXamlLexer.cs
- TCPClient.cs
- BindingGraph.cs
- LabelDesigner.cs
- SQLInt64.cs
- HMACSHA1.cs
- DiscoveryOperationContext.cs
- TextDecorationCollection.cs
- StateManagedCollection.cs
- ConfigXmlSignificantWhitespace.cs
- ChtmlImageAdapter.cs
- SchemaSetCompiler.cs
- DataSpaceManager.cs
- SafeTimerHandle.cs
- DataListCommandEventArgs.cs
- XmlSerializationReader.cs
- CustomBindingElementCollection.cs
- StylusEditingBehavior.cs
- _SslSessionsCache.cs
- NamedPipeTransportBindingElement.cs
- ExpressionBuilderContext.cs
- Container.cs
- LocalizableResourceBuilder.cs