Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / CompMod / System / Collections / Specialized / StringDictionary.cs / 1 / StringDictionary.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* */ namespace System.Collections.Specialized { using System.Runtime.InteropServices; using System.Diagnostics; using System; using System.Collections; using System.ComponentModel.Design.Serialization; using System.Globalization; ////// [Serializable] [DesignerSerializer("System.Diagnostics.Design.StringDictionaryCodeDomSerializer, " + AssemblyRef.SystemDesign, "System.ComponentModel.Design.Serialization.CodeDomSerializer, " + AssemblyRef.SystemDesign)] public class StringDictionary : IEnumerable { internal Hashtable contents = new Hashtable(); ///Implements a hashtable with the key strongly typed to be /// a string rather than an object. ////// public StringDictionary() { } ///Initializes a new instance of the System.Windows.Forms.StringDictionary class. ////// public virtual int Count { get { return contents.Count; } } ///Gets the number of key-and-value pairs in the System.Windows.Forms.StringDictionary. ////// public virtual bool IsSynchronized { get { return contents.IsSynchronized; } } ///Indicates whether access to the System.Windows.Forms.StringDictionary is synchronized (thread-safe). This property is /// read-only. ////// public virtual string this[string key] { get { if( key == null ) { throw new ArgumentNullException("key"); } return (string) contents[key.ToLower(CultureInfo.InvariantCulture)]; } set { if( key == null ) { throw new ArgumentNullException("key"); } contents[key.ToLower(CultureInfo.InvariantCulture)] = value; } } ///Gets or sets the value associated with the specified key. ////// public virtual ICollection Keys { get { return contents.Keys; } } ///Gets a collection of keys in the System.Windows.Forms.StringDictionary. ////// public virtual object SyncRoot { get { return contents.SyncRoot; } } ///Gets an object that can be used to synchronize access to the System.Windows.Forms.StringDictionary. ////// public virtual ICollection Values { get { return contents.Values; } } ///Gets a collection of values in the System.Windows.Forms.StringDictionary. ////// public virtual void Add(string key, string value) { if( key == null ) { throw new ArgumentNullException("key"); } contents.Add(key.ToLower(CultureInfo.InvariantCulture), value); } ///Adds an entry with the specified key and value into the System.Windows.Forms.StringDictionary. ////// public virtual void Clear() { contents.Clear(); } ///Removes all entries from the System.Windows.Forms.StringDictionary. ////// public virtual bool ContainsKey(string key) { if( key == null ) { throw new ArgumentNullException("key"); } return contents.ContainsKey(key.ToLower(CultureInfo.InvariantCulture)); } ///Determines if the string dictionary contains a specific key ////// public virtual bool ContainsValue(string value) { return contents.ContainsValue(value); } ///Determines if the System.Windows.Forms.StringDictionary contains a specific value. ////// public virtual void CopyTo(Array array, int index) { contents.CopyTo(array, index); } ///Copies the string dictionary values to a one-dimensional ///instance at the /// specified index. /// public virtual IEnumerator GetEnumerator() { return contents.GetEnumerator(); } ///Returns an enumerator that can iterate through the string dictionary. ////// public virtual void Remove(string key) { if( key == null ) { throw new ArgumentNullException("key"); } contents.Remove(key.ToLower(CultureInfo.InvariantCulture)); } } }Removes the entry with the specified key from the string dictionary. ///
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- MarkerProperties.cs
- basecomparevalidator.cs
- GridItemCollection.cs
- WindowsServiceElement.cs
- TdsEnums.cs
- MdiWindowListStrip.cs
- UrlPath.cs
- X509InitiatorCertificateServiceElement.cs
- FileLoadException.cs
- ErrorActivity.cs
- FtpWebResponse.cs
- Bookmark.cs
- ZipFileInfo.cs
- FactoryGenerator.cs
- ScopeElement.cs
- TypeDescriptionProviderAttribute.cs
- RoleManagerModule.cs
- ThicknessKeyFrameCollection.cs
- XamlDesignerSerializationManager.cs
- NavigatorOutput.cs
- BmpBitmapEncoder.cs
- DeviceFilterEditorDialog.cs
- WebPartUserCapability.cs
- XmlElementList.cs
- StringAttributeCollection.cs
- Convert.cs
- DivideByZeroException.cs
- MsmqInputChannel.cs
- PageCache.cs
- CodeSnippetExpression.cs
- ParameterCollectionEditor.cs
- NTAccount.cs
- ScriptResourceAttribute.cs
- filewebrequest.cs
- ListMarkerSourceInfo.cs
- XmlUtilWriter.cs
- ControlParameter.cs
- VisualTreeUtils.cs
- SpeechSynthesizer.cs
- CapiHashAlgorithm.cs
- CompilationRelaxations.cs
- DocumentApplicationJournalEntryEventArgs.cs
- DrawingVisual.cs
- CustomWebEventKey.cs
- TrustManager.cs
- QilReplaceVisitor.cs
- ToolStripSplitButton.cs
- MonikerUtility.cs
- TimelineGroup.cs
- SelectionEditingBehavior.cs
- DataGridCell.cs
- Pair.cs
- Help.cs
- DataSourceHelper.cs
- Classification.cs
- KnownIds.cs
- StateChangeEvent.cs
- DataListItemCollection.cs
- ThreadAttributes.cs
- RegexFCD.cs
- Size3DConverter.cs
- FormsAuthenticationUser.cs
- AnimationLayer.cs
- DockPanel.cs
- FileDialog_Vista_Interop.cs
- TrackBar.cs
- SerializationSectionGroup.cs
- ConditionBrowserDialog.cs
- ExpressionNode.cs
- VariableQuery.cs
- StateManagedCollection.cs
- shaper.cs
- XPathNodeIterator.cs
- DateBoldEvent.cs
- ItemCollection.cs
- ToolStripControlHost.cs
- x509store.cs
- NativeRecognizer.cs
- ConnectorDragDropGlyph.cs
- SHA1.cs
- DependentList.cs
- LocatorPartList.cs
- WebPartVerb.cs
- EdmEntityTypeAttribute.cs
- BrushValueSerializer.cs
- TypeUsageBuilder.cs
- PersianCalendar.cs
- FragmentQueryProcessor.cs
- InvalidPrinterException.cs
- BitmapCodecInfoInternal.cs
- RangeContentEnumerator.cs
- DateTimeOffsetConverter.cs
- DataTableReaderListener.cs
- StorageRoot.cs
- WebPartDesigner.cs
- SourceElementsCollection.cs
- LocalBuilder.cs
- Int32Converter.cs
- ConnectionAcceptor.cs
- SafeBitVector32.cs