Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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; } } }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- MissingSatelliteAssemblyException.cs
- CodeTypeConstructor.cs
- LiteralSubsegment.cs
- QueryOutputWriter.cs
- FamilyTypeface.cs
- TextFormatter.cs
- CodeObjectCreateExpression.cs
- unsafenativemethodstextservices.cs
- SecUtil.cs
- StackOverflowException.cs
- AmbientValueAttribute.cs
- DefaultDiscoveryServiceExtension.cs
- InteropAutomationProvider.cs
- RtfFormatStack.cs
- EmptyEnumerator.cs
- BinaryCommonClasses.cs
- TaskFormBase.cs
- ComponentChangedEvent.cs
- MatchAllMessageFilter.cs
- FlowDocument.cs
- EntityTypeEmitter.cs
- QilReference.cs
- BigInt.cs
- OleDbException.cs
- FileDataSourceCache.cs
- ConfigurationStrings.cs
- TemplateControlParser.cs
- ManagedWndProcTracker.cs
- ImageSourceTypeConverter.cs
- Clock.cs
- SingleSelectRootGridEntry.cs
- RoleManagerSection.cs
- XPathCompileException.cs
- MemberExpressionHelper.cs
- ArraySortHelper.cs
- CustomWebEventKey.cs
- HealthMonitoringSectionHelper.cs
- _RequestCacheProtocol.cs
- VersionedStream.cs
- Vector3DKeyFrameCollection.cs
- DesigntimeLicenseContext.cs
- DataControlFieldCell.cs
- RuntimeWrappedException.cs
- ScalarOps.cs
- EventRoute.cs
- RepeaterCommandEventArgs.cs
- DataGridViewSortCompareEventArgs.cs
- SemaphoreSecurity.cs
- BackgroundWorker.cs
- BindingBase.cs
- ToolStripPanelRow.cs
- ToolStripPanel.cs
- HtmlImageAdapter.cs
- DataSourceCacheDurationConverter.cs
- PolicyException.cs
- InvalidPropValue.cs
- UrlPath.cs
- RelOps.cs
- WebPartsPersonalization.cs
- EqualityComparer.cs
- PersianCalendar.cs
- FontFamily.cs
- PtsContext.cs
- IItemProperties.cs
- RepeatEnumerable.cs
- Token.cs
- RightsManagementInformation.cs
- TemplateControlCodeDomTreeGenerator.cs
- DynamicField.cs
- QueryAccessibilityHelpEvent.cs
- InternalConfigRoot.cs
- FontStyleConverter.cs
- SerialStream.cs
- FigureParagraph.cs
- RuleSettingsCollection.cs
- NamespaceInfo.cs
- AuthenticationException.cs
- WebControl.cs
- HostingEnvironment.cs
- ContextMenuService.cs
- EventBuilder.cs
- StorageModelBuildProvider.cs
- TableCell.cs
- ComponentChangedEvent.cs
- XPathBinder.cs
- ThreadExceptionEvent.cs
- EdmType.cs
- RecognizedAudio.cs
- DataServiceRequestOfT.cs
- SettingsProperty.cs
- CommandEventArgs.cs
- Expressions.cs
- mediaeventargs.cs
- CompileLiteralTextParser.cs
- ObjectQuery.cs
- IdleTimeoutMonitor.cs
- Span.cs
- MenuItemStyleCollection.cs
- HostAdapter.cs
- SimpleModelProvider.cs