Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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)); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //Removes the entry with the specified key from the string dictionary. ///// 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)); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.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
- RuleSetBrowserDialog.cs
- WebPartConnectionsEventArgs.cs
- EntityDataSourceEntityTypeFilterConverter.cs
- PolicyReader.cs
- TextEditorSpelling.cs
- SafeTimerHandle.cs
- ButtonBaseAdapter.cs
- BaseDataBoundControl.cs
- PageThemeParser.cs
- ColorMatrix.cs
- shaperfactory.cs
- Vars.cs
- XmlSchema.cs
- TemplatePropertyEntry.cs
- SharedConnectionListener.cs
- EntityRecordInfo.cs
- SafeFileHandle.cs
- AttributedMetaModel.cs
- PropertyEntry.cs
- Component.cs
- SafeRightsManagementPubHandle.cs
- DebugViewWriter.cs
- ObjectSecurity.cs
- XmlNamespaceMappingCollection.cs
- GridViewColumn.cs
- MessageCredentialType.cs
- WebPartConnectionsCloseVerb.cs
- AssemblyAttributesGoHere.cs
- DriveNotFoundException.cs
- InvalidDataContractException.cs
- UdpSocketReceiveManager.cs
- xdrvalidator.cs
- IsolatedStorageFileStream.cs
- ThreadStartException.cs
- HtmlInputPassword.cs
- ToolStripItemTextRenderEventArgs.cs
- SecurityRuntime.cs
- OpenFileDialog.cs
- SafeCoTaskMem.cs
- __Error.cs
- SqlCachedBuffer.cs
- SafeRightsManagementQueryHandle.cs
- UnmanagedMarshal.cs
- EncodingInfo.cs
- PolyQuadraticBezierSegment.cs
- DiscreteKeyFrames.cs
- RoutedEvent.cs
- UIElementParagraph.cs
- NamespaceQuery.cs
- ByteViewer.cs
- ThreadStateException.cs
- ReadOnlyDictionary.cs
- ConsoleTraceListener.cs
- StateMachineAction.cs
- GridLength.cs
- DataGridViewCellValueEventArgs.cs
- SQLInt32Storage.cs
- EventLogEntry.cs
- FontStyle.cs
- CharacterShapingProperties.cs
- AppSettingsSection.cs
- XhtmlBasicTextViewAdapter.cs
- ToolStripItemClickedEventArgs.cs
- XmlException.cs
- XmlSchemas.cs
- GenerateTemporaryTargetAssembly.cs
- GenerateTemporaryAssemblyTask.cs
- Profiler.cs
- KeyValueInternalCollection.cs
- Constants.cs
- ContainerUtilities.cs
- BitmapSizeOptions.cs
- UserMapPath.cs
- MetabaseServerConfig.cs
- BindingWorker.cs
- DataIdProcessor.cs
- TransactedBatchingElement.cs
- MenuItem.cs
- LocationUpdates.cs
- ColumnCollection.cs
- SolidColorBrush.cs
- WriteFileContext.cs
- CopyOnWriteList.cs
- ProfessionalColors.cs
- XmlSignificantWhitespace.cs
- Focus.cs
- PropertyState.cs
- ProcessInfo.cs
- CallSiteOps.cs
- LocalizationParserHooks.cs
- AssemblyCollection.cs
- DbDataAdapter.cs
- FrameworkContentElement.cs
- IisNotInstalledException.cs
- Misc.cs
- TextRunCache.cs
- AdornedElementPlaceholder.cs
- AutomationElementCollection.cs
- PagedDataSource.cs
- AsyncOperationManager.cs