Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / xsp / System / Web / Util / EmptyCollection.cs / 1 / EmptyCollection.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* * EmptyCollection class * * Copyright (c) 1999 Microsoft Corporation */ namespace System.Web.Util { using System.Collections; /* * Fast implementation of an empty collection */ internal class EmptyCollection: ICollection, IEnumerator { private static EmptyCollection s_theEmptyCollection = new EmptyCollection(); private EmptyCollection() { } // Return the same instance all the time, since it's immutable internal static EmptyCollection Instance { get { return s_theEmptyCollection; } } // ICollection implementation IEnumerator IEnumerable.GetEnumerator() { return this; } public int Count { get { return 0; } } bool ICollection.IsSynchronized { get { return true; } } object ICollection.SyncRoot { get { return this; } } public void CopyTo(Array array, int index) { } // IEnumerator implementation object IEnumerator.Current { get { return null; } } bool IEnumerator.MoveNext() { return false; } void IEnumerator.Reset() { } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* * EmptyCollection class * * Copyright (c) 1999 Microsoft Corporation */ namespace System.Web.Util { using System.Collections; /* * Fast implementation of an empty collection */ internal class EmptyCollection: ICollection, IEnumerator { private static EmptyCollection s_theEmptyCollection = new EmptyCollection(); private EmptyCollection() { } // Return the same instance all the time, since it's immutable internal static EmptyCollection Instance { get { return s_theEmptyCollection; } } // ICollection implementation IEnumerator IEnumerable.GetEnumerator() { return this; } public int Count { get { return 0; } } bool ICollection.IsSynchronized { get { return true; } } object ICollection.SyncRoot { get { return this; } } public void CopyTo(Array array, int index) { } // IEnumerator implementation object IEnumerator.Current { get { return null; } } bool IEnumerator.MoveNext() { return false; } void IEnumerator.Reset() { } } } // 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
- XmlByteStreamWriter.cs
- CodeStatementCollection.cs
- TTSEngineProxy.cs
- TabControlCancelEvent.cs
- GroupStyle.cs
- StringKeyFrameCollection.cs
- WebPartCatalogAddVerb.cs
- WebProxyScriptElement.cs
- DeflateEmulationStream.cs
- SizeAnimation.cs
- PropertyTab.cs
- GeometryDrawing.cs
- MutexSecurity.cs
- Quaternion.cs
- DetailsViewRowCollection.cs
- DefinitionProperties.cs
- InvalidCommandTreeException.cs
- XmlStreamNodeWriter.cs
- ManipulationStartedEventArgs.cs
- FilterElement.cs
- XmlTextWriter.cs
- EncryptedPackageFilter.cs
- PagesSection.cs
- Decoder.cs
- Crc32Helper.cs
- UInt64Converter.cs
- TemplateBindingExtensionConverter.cs
- ResXResourceWriter.cs
- BinaryMethodMessage.cs
- WebConvert.cs
- XNodeNavigator.cs
- CommonGetThemePartSize.cs
- XmlImplementation.cs
- HttpListenerRequest.cs
- RoutedEventConverter.cs
- TextTreeInsertElementUndoUnit.cs
- EntityContainerEmitter.cs
- ButtonBaseAdapter.cs
- DiagnosticTraceSchemas.cs
- WebPartDesigner.cs
- ExpressionBuilderContext.cs
- SimpleHandlerBuildProvider.cs
- FormConverter.cs
- DemultiplexingClientMessageFormatter.cs
- CqlWriter.cs
- DataGridViewSelectedCellCollection.cs
- Int16.cs
- Recipient.cs
- ScriptHandlerFactory.cs
- CriticalExceptions.cs
- DefaultProxySection.cs
- AttributeSetAction.cs
- AppSettingsExpressionBuilder.cs
- ServiceActivationException.cs
- OpCellTreeNode.cs
- Pts.cs
- ResponseBodyWriter.cs
- ForceCopyBuildProvider.cs
- FontCollection.cs
- SystemIPGlobalProperties.cs
- PageThemeParser.cs
- Relationship.cs
- ObjectCacheHost.cs
- designeractionbehavior.cs
- storepermissionattribute.cs
- WebPartManagerInternals.cs
- PrinterSettings.cs
- MemberProjectedSlot.cs
- SetStoryboardSpeedRatio.cs
- BamlLocalizableResourceKey.cs
- XmlILStorageConverter.cs
- ObjectDataSourceDesigner.cs
- HttpHandler.cs
- externdll.cs
- NamedObject.cs
- ErrorRuntimeConfig.cs
- Timer.cs
- Compiler.cs
- RSAOAEPKeyExchangeFormatter.cs
- DecimalKeyFrameCollection.cs
- XPathChildIterator.cs
- ListCollectionView.cs
- CacheDependency.cs
- EnumMemberAttribute.cs
- ObjectTag.cs
- StateManagedCollection.cs
- CommonObjectSecurity.cs
- SafeFileMappingHandle.cs
- TypedRowGenerator.cs
- EntityViewGenerator.cs
- StyleHelper.cs
- LookupBindingPropertiesAttribute.cs
- ThousandthOfEmRealDoubles.cs
- IChannel.cs
- DropDownList.cs
- XmlILModule.cs
- Style.cs
- FieldBuilder.cs
- DbBuffer.cs
- WebSysDisplayNameAttribute.cs