Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Net / System / Net / Mail / TrackingStringDictionary.cs / 1305376 / 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
- TextRenderer.cs
- QualificationDataItem.cs
- SupportsPreviewControlAttribute.cs
- RNGCryptoServiceProvider.cs
- MutableAssemblyCacheEntry.cs
- TextView.cs
- PersistChildrenAttribute.cs
- Assembly.cs
- _AuthenticationState.cs
- CertificateManager.cs
- XmlAnyElementAttribute.cs
- AsnEncodedData.cs
- xmlNames.cs
- XmlAttributes.cs
- WebMessageEncodingBindingElement.cs
- SharedDp.cs
- SchemaInfo.cs
- LinqDataSourceValidationException.cs
- PublisherIdentityPermission.cs
- URLMembershipCondition.cs
- GlyphManager.cs
- ControlCollection.cs
- streamingZipPartStream.cs
- SearchForVirtualItemEventArgs.cs
- Environment.cs
- InheritanceRules.cs
- Button.cs
- PolyLineSegment.cs
- LayoutEditorPart.cs
- BinHexEncoder.cs
- URLMembershipCondition.cs
- TextRange.cs
- AsyncResult.cs
- BindingBase.cs
- DataGridViewRowHeaderCell.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- JoinTreeNode.cs
- BaseDataList.cs
- TimeSpanSecondsConverter.cs
- MailAddressCollection.cs
- ContextMenuService.cs
- TextBoxAutomationPeer.cs
- PreservationFileReader.cs
- XmlSchemaSimpleTypeList.cs
- SqlErrorCollection.cs
- Int32CollectionConverter.cs
- ToolStripButton.cs
- RemotingServices.cs
- SqlConnectionStringBuilder.cs
- ReadOnlyDataSourceView.cs
- GridEntryCollection.cs
- FullTextBreakpoint.cs
- ActivationArguments.cs
- BookmarkManager.cs
- FragmentNavigationEventArgs.cs
- AlternateView.cs
- SqlConnectionFactory.cs
- BitmapEffectInputConnector.cs
- WorkflowViewStateService.cs
- XPathScanner.cs
- MenuAutomationPeer.cs
- DoubleAnimationClockResource.cs
- CssTextWriter.cs
- DropDownButton.cs
- Dump.cs
- Site.cs
- TextDecorationCollection.cs
- ServiceReference.cs
- HierarchicalDataBoundControlAdapter.cs
- TracingConnectionInitiator.cs
- RuleAction.cs
- ButtonColumn.cs
- SHA1Managed.cs
- InputLanguageSource.cs
- XmlBindingWorker.cs
- SessionPageStatePersister.cs
- StructuralType.cs
- ValueChangedEventManager.cs
- TextShapeableCharacters.cs
- Helper.cs
- TripleDES.cs
- SafeFindHandle.cs
- PseudoWebRequest.cs
- StringFormat.cs
- RepeatButton.cs
- Pair.cs
- NameNode.cs
- RoutedEventConverter.cs
- DescendantOverDescendantQuery.cs
- ExceptionHelpers.cs
- Bezier.cs
- ProtocolElementCollection.cs
- CodeNamespace.cs
- OdbcHandle.cs
- StylusDevice.cs
- HttpInputStream.cs
- PtsHelper.cs
- ColumnHeader.cs
- XmlStringTable.cs
- CriticalExceptions.cs