Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / Net / System / Net / Mail / TrackingStringDictionary.cs / 1 / TrackingStringDictionary.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Net { using System; using System.Collections; using System.Collections.Specialized; internal class TrackingStringDictionary : StringDictionary { bool isChanged; bool isReadOnly; internal TrackingStringDictionary() : this(false) { } internal TrackingStringDictionary(bool isReadOnly) { this.isReadOnly = isReadOnly; } internal bool IsChanged { get { return this.isChanged; } set { this.isChanged = value; } } public override void Add(string key, string value) { if (this.isReadOnly) throw new InvalidOperationException(SR.GetString(SR.MailCollectionIsReadOnly)); base.Add (key, value); this.isChanged = true; } public override void Clear() { if (this.isReadOnly) throw new InvalidOperationException(SR.GetString(SR.MailCollectionIsReadOnly)); base.Clear (); this.isChanged = true; } public override void Remove(string key) { if (this.isReadOnly) throw new InvalidOperationException(SR.GetString(SR.MailCollectionIsReadOnly)); base.Remove (key); this.isChanged = true; } public override string this[string key] { get { return base[key]; } set { if (this.isReadOnly) throw new InvalidOperationException(SR.GetString(SR.MailCollectionIsReadOnly)); base[key] = value; this.isChanged = true; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Net { using System; using System.Collections; using System.Collections.Specialized; internal class TrackingStringDictionary : StringDictionary { bool isChanged; bool isReadOnly; internal TrackingStringDictionary() : this(false) { } internal TrackingStringDictionary(bool isReadOnly) { this.isReadOnly = isReadOnly; } internal bool IsChanged { get { return this.isChanged; } set { this.isChanged = value; } } public override void Add(string key, string value) { if (this.isReadOnly) throw new InvalidOperationException(SR.GetString(SR.MailCollectionIsReadOnly)); base.Add (key, value); this.isChanged = true; } public override void Clear() { if (this.isReadOnly) throw new InvalidOperationException(SR.GetString(SR.MailCollectionIsReadOnly)); base.Clear (); this.isChanged = true; } public override void Remove(string key) { if (this.isReadOnly) throw new InvalidOperationException(SR.GetString(SR.MailCollectionIsReadOnly)); base.Remove (key); this.isChanged = true; } public override string this[string key] { get { return base[key]; } set { if (this.isReadOnly) throw new InvalidOperationException(SR.GetString(SR.MailCollectionIsReadOnly)); base[key] = value; this.isChanged = 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
- VirtualDirectoryMapping.cs
- ValuePattern.cs
- SchemaComplexType.cs
- CustomErrorsSectionWrapper.cs
- ConfigDefinitionUpdates.cs
- ReferenceAssemblyAttribute.cs
- SelectionList.cs
- OLEDB_Util.cs
- DataStreamFromComStream.cs
- OdbcConnectionHandle.cs
- XamlPathDataSerializer.cs
- FixedDocumentSequencePaginator.cs
- Geometry3D.cs
- PackageRelationship.cs
- ResourceContainer.cs
- SkinBuilder.cs
- CustomErrorsSection.cs
- CleanUpVirtualizedItemEventArgs.cs
- StructuralCache.cs
- Stylus.cs
- MimeObjectFactory.cs
- GeneralTransformGroup.cs
- WindowsAuthenticationModule.cs
- WebReferencesBuildProvider.cs
- ExtendedProperty.cs
- LocalBuilder.cs
- ToolStripItemRenderEventArgs.cs
- LicenseContext.cs
- ServiceModelSectionGroup.cs
- ChannelBinding.cs
- Timer.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- OdbcConnection.cs
- DocumentPageViewAutomationPeer.cs
- WebService.cs
- SpecularMaterial.cs
- Viewport2DVisual3D.cs
- ShaderEffect.cs
- CompilerParameters.cs
- Line.cs
- AssemblyFilter.cs
- ViewLoader.cs
- HtmlMeta.cs
- PublisherIdentityPermission.cs
- ControlIdConverter.cs
- FontFaceLayoutInfo.cs
- ImplicitInputBrush.cs
- _LazyAsyncResult.cs
- EqualityComparer.cs
- NativeMethods.cs
- ClearCollection.cs
- QilStrConcat.cs
- TypeToArgumentTypeConverter.cs
- ColorInterpolationModeValidation.cs
- HttpCacheVaryByContentEncodings.cs
- ResizeGrip.cs
- Rfc2898DeriveBytes.cs
- FrameworkElementAutomationPeer.cs
- ListParaClient.cs
- HMACRIPEMD160.cs
- RangeValuePattern.cs
- WebPartZoneBase.cs
- Attributes.cs
- EventLogPermissionAttribute.cs
- XmlDownloadManager.cs
- ResourceCategoryAttribute.cs
- SqlInfoMessageEvent.cs
- HandlerFactoryCache.cs
- ArrayHelper.cs
- ImmutablePropertyDescriptorGridEntry.cs
- RegistryKey.cs
- WsdlBuildProvider.cs
- BamlTreeNode.cs
- Transactions.cs
- BrushValueSerializer.cs
- PixelFormat.cs
- VirtualPath.cs
- ComponentManagerBroker.cs
- XmlWellformedWriter.cs
- RangeValidator.cs
- PageAsyncTaskManager.cs
- DispatcherObject.cs
- SHA1Cng.cs
- ButtonRenderer.cs
- SqlException.cs
- FtpRequestCacheValidator.cs
- FieldNameLookup.cs
- DesignerCategoryAttribute.cs
- KeyToListMap.cs
- Property.cs
- StringToken.cs
- FontNamesConverter.cs
- SchemaType.cs
- SoapSchemaMember.cs
- WebPartsSection.cs
- ScriptingSectionGroup.cs
- SHA512Managed.cs
- SignatureToken.cs
- AccessDataSourceWizardForm.cs
- ProfileManager.cs