Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- CodeDOMUtility.cs
- AttributeExtensions.cs
- WorkflowMarkupSerializationProvider.cs
- HttpBindingExtension.cs
- DataGridTablesFactory.cs
- InternalMappingException.cs
- _Events.cs
- DataGridViewRowCancelEventArgs.cs
- TrackingMemoryStreamFactory.cs
- TextEditorParagraphs.cs
- NeutralResourcesLanguageAttribute.cs
- XhtmlBasicLiteralTextAdapter.cs
- Attributes.cs
- CallbackValidatorAttribute.cs
- ProcessThread.cs
- MergeFailedEvent.cs
- XmlAnyAttributeAttribute.cs
- ListViewItemSelectionChangedEvent.cs
- PeerObject.cs
- HttpModuleAction.cs
- ContextQuery.cs
- ProtocolsConfiguration.cs
- MissingSatelliteAssemblyException.cs
- SHA384Managed.cs
- MemberProjectionIndex.cs
- XamlStream.cs
- TriggerAction.cs
- XmlTextReaderImplHelpers.cs
- OracleBinary.cs
- CodeGroup.cs
- DeferredTextReference.cs
- TypeResolver.cs
- ComponentChangingEvent.cs
- PersianCalendar.cs
- TaskResultSetter.cs
- CompositeFontInfo.cs
- DocumentOutline.cs
- CacheVirtualItemsEvent.cs
- SerializerDescriptor.cs
- LayoutEvent.cs
- TableAdapterManagerMethodGenerator.cs
- XamlContextStack.cs
- RelationshipManager.cs
- BaseCodeDomTreeGenerator.cs
- ColumnResult.cs
- TypeDescriptor.cs
- MachineKeySection.cs
- PolyBezierSegmentFigureLogic.cs
- UnmanagedBitmapWrapper.cs
- PageCache.cs
- WorkflowQueuingService.cs
- InvalidPrinterException.cs
- HandleCollector.cs
- ExtentCqlBlock.cs
- CompiledQueryCacheEntry.cs
- TabItem.cs
- SettingsSavedEventArgs.cs
- InputReportEventArgs.cs
- HtmlHead.cs
- SourceSwitch.cs
- GroupDescription.cs
- SystemIcmpV4Statistics.cs
- elementinformation.cs
- UnSafeCharBuffer.cs
- SourceChangedEventArgs.cs
- OSFeature.cs
- TraceSection.cs
- DataGridViewTextBoxEditingControl.cs
- Token.cs
- PropertyItem.cs
- Padding.cs
- AppDomainInstanceProvider.cs
- PropertyValidationContext.cs
- XmlBaseReader.cs
- InvokeSchedule.cs
- MediaPlayerState.cs
- XmlSchemaCompilationSettings.cs
- NativeWindow.cs
- ProviderSettingsCollection.cs
- CalloutQueueItem.cs
- HashCodeCombiner.cs
- FactoryGenerator.cs
- MarshalByValueComponent.cs
- SimpleTextLine.cs
- SqlGenericUtil.cs
- BindingManagerDataErrorEventArgs.cs
- NativeActivity.cs
- CodeChecksumPragma.cs
- DataGridViewRowConverter.cs
- RSAOAEPKeyExchangeFormatter.cs
- OdbcConnectionString.cs
- BinaryObjectWriter.cs
- CustomAttribute.cs
- SiteMapNode.cs
- Trace.cs
- DocumentViewerBase.cs
- DataGridViewButtonColumn.cs
- IFormattable.cs
- BoolExpr.cs
- BuiltInExpr.cs