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
- CodeSnippetExpression.cs
- TypeExtensionConverter.cs
- UInt64Converter.cs
- SpeechSynthesizer.cs
- ObjectStateEntry.cs
- XPathNavigator.cs
- AnimationException.cs
- OdbcConnectionHandle.cs
- DataControlFieldCollection.cs
- AppSettingsReader.cs
- CacheOutputQuery.cs
- ProxyAttribute.cs
- GridViewColumnHeaderAutomationPeer.cs
- ArgumentOutOfRangeException.cs
- WebScriptClientGenerator.cs
- TdsParserSessionPool.cs
- XdrBuilder.cs
- X509CertificateValidationMode.cs
- RegionData.cs
- XmlTypeMapping.cs
- ResourceDictionaryCollection.cs
- TransformedBitmap.cs
- View.cs
- XappLauncher.cs
- PersonalizationProviderHelper.cs
- XmlConvert.cs
- ButtonRenderer.cs
- AssociationTypeEmitter.cs
- TextLineBreak.cs
- ArgumentOutOfRangeException.cs
- HelpKeywordAttribute.cs
- Model3DCollection.cs
- PermissionAttributes.cs
- DelegateArgumentReference.cs
- Event.cs
- DbException.cs
- TempFiles.cs
- DataGridViewTextBoxEditingControl.cs
- ProxyWebPart.cs
- AttributeQuery.cs
- ControlBuilderAttribute.cs
- ExpandableObjectConverter.cs
- ViewStateException.cs
- SelectionRangeConverter.cs
- SqlFacetAttribute.cs
- ExpressionBuilder.cs
- XmlWellformedWriter.cs
- ValidationService.cs
- RecipientInfo.cs
- ReadContentAsBinaryHelper.cs
- Identity.cs
- ResourceDictionaryCollection.cs
- URLMembershipCondition.cs
- EntityDataSourceChangedEventArgs.cs
- ReadOnlyDictionary.cs
- DeclaredTypeElement.cs
- ItemList.cs
- WebPartPersonalization.cs
- CqlGenerator.cs
- TextTreeInsertUndoUnit.cs
- DoneReceivingAsyncResult.cs
- Frame.cs
- Scanner.cs
- ProjectionPlan.cs
- XamlFigureLengthSerializer.cs
- ConstructorNeedsTagAttribute.cs
- EditorPart.cs
- SubqueryTrackingVisitor.cs
- PartialToken.cs
- BaseCollection.cs
- AdCreatedEventArgs.cs
- JapaneseCalendar.cs
- JoinGraph.cs
- ResourceLoader.cs
- Page.cs
- _emptywebproxy.cs
- KnownBoxes.cs
- IsolatedStorageFile.cs
- ByteStorage.cs
- FixedFindEngine.cs
- KeyTimeConverter.cs
- WindowsComboBox.cs
- Synchronization.cs
- documentsequencetextpointer.cs
- MenuItem.cs
- MarkupCompiler.cs
- CustomMenuItemCollection.cs
- XmlSchemaAnnotation.cs
- PlaceHolder.cs
- LockedAssemblyCache.cs
- mactripleDES.cs
- ApplicationException.cs
- DialogResultConverter.cs
- TextEditorMouse.cs
- COM2DataTypeToManagedDataTypeConverter.cs
- GridViewCancelEditEventArgs.cs
- PeerNodeAddress.cs
- DPCustomTypeDescriptor.cs
- OperationCanceledException.cs
- TempEnvironment.cs