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
- SimpleWorkerRequest.cs
- XmlSerializationReader.cs
- NavigationPropertyEmitter.cs
- DataGridViewIntLinkedList.cs
- BrowsableAttribute.cs
- DataGridViewEditingControlShowingEventArgs.cs
- DynamicResourceExtension.cs
- XamlBuildProvider.cs
- WindowsTokenRoleProvider.cs
- GridViewDesigner.cs
- WebReferenceCollection.cs
- StylusDownEventArgs.cs
- Itemizer.cs
- XmlSerializerSection.cs
- State.cs
- _DomainName.cs
- DefaultParameterValueAttribute.cs
- LinqDataView.cs
- ErrorStyle.cs
- XmlFormatReaderGenerator.cs
- ScaleTransform.cs
- WmpBitmapEncoder.cs
- ChainedAsyncResult.cs
- HttpWebResponse.cs
- TextSearch.cs
- WebPartConnectionsCancelVerb.cs
- WindowsNonControl.cs
- RegexStringValidator.cs
- cache.cs
- BackgroundWorker.cs
- RegexReplacement.cs
- InheritablePropertyChangeInfo.cs
- SqlDataSourceCommandEventArgs.cs
- HyperLinkColumn.cs
- Journaling.cs
- AnchoredBlock.cs
- HttpMethodAttribute.cs
- _AutoWebProxyScriptWrapper.cs
- DataGridViewImageCell.cs
- ClientSettings.cs
- TypeInitializationException.cs
- EdmToObjectNamespaceMap.cs
- SlipBehavior.cs
- SqlDelegatedTransaction.cs
- XslAst.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- SafeNativeMethods.cs
- ListItemParagraph.cs
- FrameworkContentElement.cs
- SQLMembershipProvider.cs
- TraceRecord.cs
- ImageBrush.cs
- XmlNavigatorStack.cs
- ApplicationInfo.cs
- OpenTypeCommon.cs
- _ListenerRequestStream.cs
- Int32CAMarshaler.cs
- rsa.cs
- OSFeature.cs
- NestedContainer.cs
- EditingCommands.cs
- DiscoveryDocumentSearchPattern.cs
- XmlSchemaSimpleType.cs
- SamlSubject.cs
- HandleCollector.cs
- IdleTimeoutMonitor.cs
- WindowsAuthenticationEventArgs.cs
- LinearKeyFrames.cs
- ButtonFlatAdapter.cs
- ScrollableControl.cs
- NativeMethods.cs
- ConversionValidationRule.cs
- VisualStyleInformation.cs
- Fonts.cs
- InputManager.cs
- WebPartManagerInternals.cs
- TextAnchor.cs
- HtmlTernaryTree.cs
- ChtmlImageAdapter.cs
- GZipDecoder.cs
- BufferedGraphics.cs
- PrivilegedConfigurationManager.cs
- FontFamilyIdentifier.cs
- TdsParserSessionPool.cs
- TypeRefElement.cs
- BookmarkScopeManager.cs
- SqlCrossApplyToCrossJoin.cs
- HtmlElementCollection.cs
- ErrorProvider.cs
- DuplicateWaitObjectException.cs
- GraphicsContext.cs
- XmlCustomFormatter.cs
- Property.cs
- TrustManager.cs
- Error.cs
- EntityClientCacheKey.cs
- ServiceInstallComponent.cs
- XmlSchemaComplexContentExtension.cs
- StyleSheetComponentEditor.cs
- BulletedListEventArgs.cs