Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Collections / IDictionary.cs / 1305376 / IDictionary.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Interface: IDictionary ** **[....] ** ** ** Purpose: Base interface for all dictionaries. ** ** ===========================================================*/ namespace System.Collections { using System; using System.Diagnostics.Contracts; // An IDictionary is a possibly unordered set of key-value pairs. // Keys can be any non-null object. Values can be any object. // You can look up a value in an IDictionary via the default indexed // property, Items. [ContractClass(typeof(IDictionaryContract))] [System.Runtime.InteropServices.ComVisible(true)] public interface IDictionary : ICollection { // Interfaces are not serializable // The Item property provides methods to read and edit entries // in the Dictionary. Object this[Object key] { get; set; } // Returns a collections of the keys in this dictionary. ICollection Keys { get; } // Returns a collections of the values in this dictionary. ICollection Values { get; } // Returns whether this dictionary contains a particular key. // bool Contains(Object key); // Adds a key-value pair to the dictionary. // void Add(Object key, Object value); // Removes all pairs from the dictionary. void Clear(); bool IsReadOnly { get; } bool IsFixedSize { get; } // Returns an IDictionaryEnumerator for this dictionary. new IDictionaryEnumerator GetEnumerator(); // Removes a particular key from the dictionary. // void Remove(Object key); } [ContractClassFor(typeof(IDictionary))] internal class IDictionaryContract : IDictionary { Object IDictionary.this[Object key] { get { return default(Object); } set { } } ICollection IDictionary.Keys { get { Contract.Ensures(Contract.Result() != null); //Contract.Ensures(Contract.Result ().Count == ((ICollection)this).Count); return default(ICollection); } } ICollection IDictionary.Values { get { Contract.Ensures(Contract.Result () != null); return default(ICollection); } } bool IDictionary.Contains(Object key) { return default(bool); } void IDictionary.Add(Object key, Object value) { } void IDictionary.Clear() { } bool IDictionary.IsReadOnly { get { return default(bool); } } bool IDictionary.IsFixedSize { get { return default(bool); } } IDictionaryEnumerator IDictionary.GetEnumerator() { Contract.Ensures(Contract.Result () != null); return default(IDictionaryEnumerator); } void IDictionary.Remove(Object key) { } #region ICollection members void ICollection.CopyTo(Array array, int index) { } int ICollection.Count { get { Contract.Ensures(Contract.Result () >= 0); return default(int); } } Object ICollection.SyncRoot { get { Contract.Ensures(Contract.Result
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- RegexReplacement.cs
- Clipboard.cs
- InputLanguageManager.cs
- DragEvent.cs
- EntityClientCacheKey.cs
- TileBrush.cs
- TextProperties.cs
- ExpressionBuilder.cs
- PathGradientBrush.cs
- ErrorTolerantObjectWriter.cs
- XmlUnspecifiedAttribute.cs
- SafeLibraryHandle.cs
- DataControlPagerLinkButton.cs
- StrokeRenderer.cs
- Registry.cs
- XmlSchemaSimpleTypeUnion.cs
- IfAction.cs
- SmiMetaDataProperty.cs
- TableParagraph.cs
- Mappings.cs
- CipherData.cs
- WindowCollection.cs
- BamlLocalizabilityResolver.cs
- DrawingAttributesDefaultValueFactory.cs
- FormsAuthenticationUserCollection.cs
- OverflowException.cs
- BufferedStream.cs
- SimpleHandlerFactory.cs
- LineGeometry.cs
- RuntimeTransactionHandle.cs
- DataGridViewToolTip.cs
- MsmqHostedTransportConfiguration.cs
- SByteConverter.cs
- DivideByZeroException.cs
- TableDesigner.cs
- XmlSchemaIdentityConstraint.cs
- ReadOnlyTernaryTree.cs
- BufferedReadStream.cs
- StylusTip.cs
- AtomMaterializer.cs
- JobDuplex.cs
- BuildProvidersCompiler.cs
- DataGridViewAdvancedBorderStyle.cs
- XsltConvert.cs
- CookielessHelper.cs
- DocumentPageHost.cs
- UnmanagedMemoryStream.cs
- StatusBar.cs
- HighlightVisual.cs
- diagnosticsswitches.cs
- Geometry3D.cs
- UnsafeNetInfoNativeMethods.cs
- GradientStop.cs
- CredentialManagerDialog.cs
- PatternMatchRules.cs
- _ListenerAsyncResult.cs
- EntityContainerEntitySetDefiningQuery.cs
- ComponentDispatcherThread.cs
- ContainsRowNumberChecker.cs
- _SecureChannel.cs
- MetadataItemEmitter.cs
- XpsS0ValidatingLoader.cs
- BitmapEffectDrawingContent.cs
- Bold.cs
- RectangleHotSpot.cs
- MSAANativeProvider.cs
- PagedDataSource.cs
- EncoderFallback.cs
- EditableTreeList.cs
- VirtualPathUtility.cs
- TableParagraph.cs
- XmlImplementation.cs
- TraceHwndHost.cs
- DefaultIfEmptyQueryOperator.cs
- HostExecutionContextManager.cs
- SqlProviderServices.cs
- PaperSize.cs
- ChangePasswordDesigner.cs
- IfAction.cs
- ipaddressinformationcollection.cs
- HtmlForm.cs
- ObservableCollection.cs
- SystemFonts.cs
- WorkflowExecutor.cs
- WrappedKeySecurityTokenParameters.cs
- CellParagraph.cs
- objectquery_tresulttype.cs
- ApplicationFileParser.cs
- LoginAutoFormat.cs
- COM2EnumConverter.cs
- NameTable.cs
- SettingsProviderCollection.cs
- XPathPatternBuilder.cs
- ColorContext.cs
- MaterialGroup.cs
- PropertyItem.cs
- AnonymousIdentificationModule.cs
- PasswordDeriveBytes.cs
- MetaModel.cs
- AbstractSvcMapFileLoader.cs