Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- XmlReaderSettings.cs
- WebPartPersonalization.cs
- BeginStoryboard.cs
- DesignerAutoFormat.cs
- DetailsViewInsertedEventArgs.cs
- SymbolType.cs
- ListView.cs
- MatrixConverter.cs
- SQLGuid.cs
- AdvancedBindingPropertyDescriptor.cs
- InstanceCreationEditor.cs
- AuthorizationSection.cs
- XmlHierarchicalDataSourceView.cs
- PointAnimationBase.cs
- ZipIOExtraFieldPaddingElement.cs
- ActivationService.cs
- Delay.cs
- TransformCollection.cs
- MappingMetadataHelper.cs
- ObjectDisposedException.cs
- _NegoStream.cs
- ScrollChangedEventArgs.cs
- NumericExpr.cs
- SharedConnectionWorkflowTransactionService.cs
- OAVariantLib.cs
- XmlStreamNodeWriter.cs
- ResolveCriteriaApril2005.cs
- ReadonlyMessageFilter.cs
- OrderByQueryOptionExpression.cs
- SymbolPair.cs
- ComboBox.cs
- RequestUriProcessor.cs
- ViewEvent.cs
- ScrollProperties.cs
- ProfessionalColorTable.cs
- OleDbDataAdapter.cs
- RTTrackingProfile.cs
- SequenceDesigner.cs
- OdbcException.cs
- AutomationPropertyChangedEventArgs.cs
- SymbolMethod.cs
- CustomAttributeBuilder.cs
- CodeSnippetCompileUnit.cs
- Column.cs
- Base64Stream.cs
- SqlInternalConnectionTds.cs
- PageStatePersister.cs
- TransformGroup.cs
- AppModelKnownContentFactory.cs
- CompatibleComparer.cs
- PassportAuthenticationModule.cs
- DBSqlParserTableCollection.cs
- TCPClient.cs
- StructuredTypeInfo.cs
- UInt32Storage.cs
- handlecollector.cs
- ProxyHelper.cs
- prompt.cs
- RootBrowserWindow.cs
- BuildDependencySet.cs
- MsmqException.cs
- Cursor.cs
- FunctionDescription.cs
- HtmlUtf8RawTextWriter.cs
- XmlNamespaceMapping.cs
- Page.cs
- DerivedKeySecurityToken.cs
- ReadOnlyDataSource.cs
- TextServicesHost.cs
- StorageEntityContainerMapping.cs
- XsdBuilder.cs
- ConsumerConnectionPointCollection.cs
- ColorMap.cs
- SourceSwitch.cs
- SchemaType.cs
- PrimitiveXmlSerializers.cs
- ListViewTableCell.cs
- DefaultValidator.cs
- HashHelpers.cs
- FileNotFoundException.cs
- FixedBufferAttribute.cs
- TextContainerChangeEventArgs.cs
- XmlCollation.cs
- ConfigurationCollectionAttribute.cs
- EDesignUtil.cs
- GroupByExpressionRewriter.cs
- ControlFilterExpression.cs
- EntityContainerAssociationSet.cs
- PointAnimationBase.cs
- Logging.cs
- DecoderReplacementFallback.cs
- TableRowGroup.cs
- WindowsImpersonationContext.cs
- RelationshipDetailsRow.cs
- BitmapEffectGroup.cs
- MSHTMLHost.cs
- ActivityExecutorSurrogate.cs
- DbModificationClause.cs
- LinkedResourceCollection.cs
- ETagAttribute.cs