Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / Util / EmptyCollection.cs / 1305376 / 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
- TimeSpanOrInfiniteConverter.cs
- DbConnectionFactory.cs
- ConfigurationSectionGroupCollection.cs
- basecomparevalidator.cs
- Point3DAnimationUsingKeyFrames.cs
- TableItemStyle.cs
- ArgIterator.cs
- BackStopAuthenticationModule.cs
- TimelineCollection.cs
- DecimalFormatter.cs
- NeutralResourcesLanguageAttribute.cs
- ViewCellRelation.cs
- SyndicationSerializer.cs
- GlobalDataBindingHandler.cs
- StringUtil.cs
- _ConnectionGroup.cs
- RegexNode.cs
- Logging.cs
- ErrorWebPart.cs
- DBSqlParserColumnCollection.cs
- ListSourceHelper.cs
- XPathNode.cs
- ResolveMatchesCD1.cs
- FunctionDescription.cs
- DrawingDrawingContext.cs
- BuiltInExpr.cs
- BatchServiceHost.cs
- CompiledELinqQueryState.cs
- InternalConfigEventArgs.cs
- GlobalProxySelection.cs
- Attributes.cs
- TextBoxLine.cs
- XmlSchemaType.cs
- PageThemeCodeDomTreeGenerator.cs
- HttpProfileGroupBase.cs
- SimpleWebHandlerParser.cs
- SqlFlattener.cs
- DataGridViewCellParsingEventArgs.cs
- ColumnReorderedEventArgs.cs
- ProofTokenCryptoHandle.cs
- ValidationSettings.cs
- FontResourceCache.cs
- TemplateApplicationHelper.cs
- PseudoWebRequest.cs
- StagingAreaInputItem.cs
- TableItemStyle.cs
- Nodes.cs
- SelectionListDesigner.cs
- MinMaxParagraphWidth.cs
- Range.cs
- PointCollection.cs
- DuplexChannelBinder.cs
- PipelineModuleStepContainer.cs
- XamlDesignerSerializationManager.cs
- SQLByte.cs
- TextProperties.cs
- controlskin.cs
- ObjectDataProvider.cs
- RemoteWebConfigurationHost.cs
- ScalarRestriction.cs
- unsafenativemethodsother.cs
- ChangeNode.cs
- XmlRootAttribute.cs
- MetafileHeaderWmf.cs
- RtfFormatStack.cs
- CachedBitmap.cs
- MouseGestureValueSerializer.cs
- FastPropertyAccessor.cs
- SerializerDescriptor.cs
- HtmlInputHidden.cs
- ProxySimple.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- EmbeddedMailObjectsCollection.cs
- BaseDataBoundControl.cs
- DbDeleteCommandTree.cs
- CodeValidator.cs
- FontEmbeddingManager.cs
- MethodAccessException.cs
- CacheMemory.cs
- DataControlFieldHeaderCell.cs
- DeadCharTextComposition.cs
- ColorAnimationUsingKeyFrames.cs
- StorageRoot.cs
- DocumentViewerBase.cs
- ReaderWriterLockWrapper.cs
- AssemblyContextControlItem.cs
- TextMarkerSource.cs
- _NetworkingPerfCounters.cs
- LayoutDump.cs
- PTProvider.cs
- ByteFacetDescriptionElement.cs
- QueryableDataSourceEditData.cs
- ThemeDirectoryCompiler.cs
- RSAPKCS1SignatureFormatter.cs
- WebBrowserNavigatingEventHandler.cs
- TraceFilter.cs
- Message.cs
- XsltOutput.cs
- XmlWriter.cs
- TextLine.cs