Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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() { } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- COM2ColorConverter.cs
- SafeEventLogWriteHandle.cs
- CodeGen.cs
- AbandonedMutexException.cs
- EventListenerClientSide.cs
- ReflectTypeDescriptionProvider.cs
- ScrollItemPattern.cs
- DataGridViewUtilities.cs
- OdbcConnection.cs
- RelationHandler.cs
- HtmlInputRadioButton.cs
- GenericEnumerator.cs
- TileBrush.cs
- Message.cs
- TreeViewDesigner.cs
- ImmutablePropertyDescriptorGridEntry.cs
- ConfigXmlWhitespace.cs
- LocalizedNameDescriptionPair.cs
- FormViewPageEventArgs.cs
- DetailsViewModeEventArgs.cs
- XmlSchemaCollection.cs
- TextRunCache.cs
- ParsedAttributeCollection.cs
- CodeVariableReferenceExpression.cs
- PerformanceCounterCategory.cs
- WebPartConnectionsCancelEventArgs.cs
- SessionStateContainer.cs
- loginstatus.cs
- xmlfixedPageInfo.cs
- IisTraceListener.cs
- HandlerWithFactory.cs
- TraceHandlerErrorFormatter.cs
- BrowserCapabilitiesFactoryBase.cs
- XsdDateTime.cs
- FontStyle.cs
- HostedImpersonationContext.cs
- CqlLexerHelpers.cs
- ParserHooks.cs
- DataGridViewCellConverter.cs
- DBConcurrencyException.cs
- _TLSstream.cs
- CursorConverter.cs
- RegexRunner.cs
- EntitySqlQueryCacheKey.cs
- HiddenFieldPageStatePersister.cs
- OracleConnectionFactory.cs
- HostProtectionPermission.cs
- WebPartManager.cs
- OutputScopeManager.cs
- GuidConverter.cs
- TextStore.cs
- MetadataProperty.cs
- NumberSubstitution.cs
- SmiMetaDataProperty.cs
- SchemaElementDecl.cs
- PerfCounterSection.cs
- DataSourceXmlClassAttribute.cs
- MaskedTextBox.cs
- MulticastNotSupportedException.cs
- TransformCryptoHandle.cs
- DoubleStorage.cs
- Function.cs
- Vector3D.cs
- CompatibleIComparer.cs
- sqlser.cs
- ExpressionConverter.cs
- LabelLiteral.cs
- SiteMapNodeItem.cs
- BuildProvider.cs
- TagNameToTypeMapper.cs
- ActivityBuilderHelper.cs
- SecurityTokenValidationException.cs
- XamlVector3DCollectionSerializer.cs
- DetailsViewDesigner.cs
- JsonServiceDocumentSerializer.cs
- COSERVERINFO.cs
- SuppressMergeCheckAttribute.cs
- _TLSstream.cs
- SerializationBinder.cs
- ExistsInCollection.cs
- DataTemplate.cs
- ExpandCollapseProviderWrapper.cs
- DataControlReferenceCollection.cs
- XmlElementCollection.cs
- RegisteredHiddenField.cs
- CompilerResults.cs
- DetailsViewRow.cs
- WebColorConverter.cs
- ValidationVisibilityAttribute.cs
- FrameDimension.cs
- BoolExpressionVisitors.cs
- SocketAddress.cs
- TreeWalkHelper.cs
- ellipse.cs
- CreateUserWizardStep.cs
- BitmapImage.cs
- RequestTimeoutManager.cs
- IOException.cs
- FlowDocumentReader.cs
- CompositeDataBoundControl.cs