Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / 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. //------------------------------------------------------------------------------ //// 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TypeSystem.cs
- StreamWriter.cs
- TypeHelpers.cs
- WebPartConnectionsCancelVerb.cs
- TriggerBase.cs
- DocumentSchemaValidator.cs
- EnumConverter.cs
- Facet.cs
- ParseHttpDate.cs
- ThousandthOfEmRealPoints.cs
- entitydatasourceentitysetnameconverter.cs
- WeakRefEnumerator.cs
- ScriptRegistrationManager.cs
- EncoderFallback.cs
- CaretElement.cs
- SQLMoney.cs
- Comparer.cs
- XmlSchemaElement.cs
- WebPartZoneCollection.cs
- TableParagraph.cs
- SkewTransform.cs
- MetadataProperty.cs
- ScriptIgnoreAttribute.cs
- TextServicesCompartmentEventSink.cs
- ConfigurationFileMap.cs
- WebUtil.cs
- Int16AnimationUsingKeyFrames.cs
- XPathDescendantIterator.cs
- DefaultEventAttribute.cs
- Pair.cs
- ListViewGroup.cs
- DocumentCollection.cs
- GacUtil.cs
- StoreItemCollection.Loader.cs
- AnimationException.cs
- ManagementBaseObject.cs
- InputLangChangeRequestEvent.cs
- StandardOleMarshalObject.cs
- ToolboxComponentsCreatedEventArgs.cs
- DBConnectionString.cs
- CapabilitiesState.cs
- IgnoreFileBuildProvider.cs
- DbDataSourceEnumerator.cs
- WhitespaceRuleReader.cs
- Journaling.cs
- Visual3D.cs
- autovalidator.cs
- StaticFileHandler.cs
- ToolboxService.cs
- OleDbTransaction.cs
- NativeObjectSecurity.cs
- PropertyOverridesDialog.cs
- UnitySerializationHolder.cs
- LogicalTreeHelper.cs
- Type.cs
- InitializerFacet.cs
- RegexParser.cs
- HtmlTextArea.cs
- StylusPointProperty.cs
- WmlSelectionListAdapter.cs
- Misc.cs
- ObjectItemConventionAssemblyLoader.cs
- ConfigsHelper.cs
- SecondaryIndexList.cs
- ICollection.cs
- DesignTimeParseData.cs
- GridViewColumn.cs
- ContentTextAutomationPeer.cs
- _NegoState.cs
- HMACSHA512.cs
- SchemaSetCompiler.cs
- MessageAction.cs
- PolyQuadraticBezierSegment.cs
- EtwProvider.cs
- SafeFileMappingHandle.cs
- UnorderedHashRepartitionStream.cs
- TrackingAnnotationCollection.cs
- InfoCardArgumentException.cs
- ExpressionPrefixAttribute.cs
- DependencyPropertyChangedEventArgs.cs
- EntitySetBase.cs
- RawStylusActions.cs
- Baml2006KnownTypes.cs
- Rotation3DAnimationUsingKeyFrames.cs
- mediapermission.cs
- FixedDSBuilder.cs
- SyntaxCheck.cs
- TextDecorationCollection.cs
- EntityDesignerUtils.cs
- SmtpFailedRecipientException.cs
- DataControlFieldHeaderCell.cs
- Path.cs
- MultiSelectRootGridEntry.cs
- DesignDataSource.cs
- InputChannelBinder.cs
- SqlTopReducer.cs
- SapiInterop.cs
- CodeIndexerExpression.cs
- SHA384Cng.cs
- FaultBookmark.cs