Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / NetFx35 / System.ServiceModel.Web / System / Collections / ObjectModel / FreezableCollection.cs / 2 / FreezableCollection.cs
//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.Collections.ObjectModel { using System; using System.Collections.Generic; using System.ServiceModel; class FreezableCollection: Collection , ICollection { bool frozen; public FreezableCollection() : base() { } public FreezableCollection(IList list) : base(list) { } public bool IsFrozen { get { return this.frozen; } } bool ICollection .IsReadOnly { get { return this.frozen; } } public void Freeze() { this.frozen = true; } protected override void ClearItems() { ThrowIfFrozen(); base.ClearItems(); } protected override void InsertItem(int index, T item) { ThrowIfFrozen(); base.InsertItem(index, item); } protected override void RemoveItem(int index) { ThrowIfFrozen(); base.RemoveItem(index); } protected override void SetItem(int index, T item) { ThrowIfFrozen(); base.SetItem(index, item); } void ThrowIfFrozen() { if (this.frozen) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.ObjectIsReadOnly)); } } } } // 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
- GlobalItem.cs
- NativeMethods.cs
- unsafenativemethodsother.cs
- PenThread.cs
- WeakReference.cs
- SqlGenericUtil.cs
- GenericWebPart.cs
- WorkflowMarkupSerializationException.cs
- SHA1CryptoServiceProvider.cs
- ExpressionBuilderCollection.cs
- Helper.cs
- FontStretch.cs
- Expr.cs
- FilterException.cs
- CacheForPrimitiveTypes.cs
- TemplatedMailWebEventProvider.cs
- SelectionPatternIdentifiers.cs
- SerializerWriterEventHandlers.cs
- TrustSection.cs
- SmiEventSink_Default.cs
- BamlVersionHeader.cs
- XmlDocumentFragment.cs
- RichTextBoxConstants.cs
- TcpServerChannel.cs
- AuthenticateEventArgs.cs
- ReflectionServiceProvider.cs
- ContentFilePart.cs
- TextTreeRootTextBlock.cs
- Vars.cs
- DataServiceQuery.cs
- SoapSchemaExporter.cs
- IndicShape.cs
- BitmapImage.cs
- FormatConvertedBitmap.cs
- OracleConnectionString.cs
- PagedDataSource.cs
- SimpleMailWebEventProvider.cs
- ProtocolsConfigurationHandler.cs
- ButtonStandardAdapter.cs
- XmlAnyElementAttributes.cs
- xml.cs
- SqlDataReaderSmi.cs
- UrlPropertyAttribute.cs
- Container.cs
- XmlElementAttributes.cs
- CompilerScopeManager.cs
- ValidationService.cs
- SqlDataSourceCache.cs
- relpropertyhelper.cs
- CompilerGlobalScopeAttribute.cs
- InstanceKeyCompleteException.cs
- ViewCellSlot.cs
- Vector3DAnimationBase.cs
- TextEditorCopyPaste.cs
- FieldNameLookup.cs
- SystemTcpStatistics.cs
- SqlNotificationEventArgs.cs
- XmlSchemaType.cs
- XmlSubtreeReader.cs
- Rect3DValueSerializer.cs
- StatusCommandUI.cs
- Profiler.cs
- AccessDataSourceWizardForm.cs
- FieldAccessException.cs
- DataGridViewAdvancedBorderStyle.cs
- ClassHandlersStore.cs
- PageAsyncTask.cs
- ContextMenuStrip.cs
- GridItemCollection.cs
- Vector3DAnimationUsingKeyFrames.cs
- PanelContainerDesigner.cs
- DiscoveryClientDocuments.cs
- CodeDOMProvider.cs
- HwndHost.cs
- OleDbPermission.cs
- FastEncoder.cs
- BindingMemberInfo.cs
- HttpProxyCredentialType.cs
- _NestedMultipleAsyncResult.cs
- SchemaDeclBase.cs
- MediaEntryAttribute.cs
- XmlNamespaceMappingCollection.cs
- OrderedDictionary.cs
- ToolStripContainerDesigner.cs
- ToolboxItemSnapLineBehavior.cs
- SubqueryTrackingVisitor.cs
- SocketInformation.cs
- NullExtension.cs
- DigitalSignature.cs
- TableStyle.cs
- WorkflowControlClient.cs
- XmlSchemaComplexContentExtension.cs
- ContractValidationHelper.cs
- EventListener.cs
- OraclePermission.cs
- TextFindEngine.cs
- StylusPointPropertyId.cs
- WarningException.cs
- SafeCertificateStore.cs
- ConfigXmlComment.cs