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
- Size.cs
- ZipArchive.cs
- StringKeyFrameCollection.cs
- XPathDescendantIterator.cs
- ElementMarkupObject.cs
- ReadOnlyMetadataCollection.cs
- InkCanvasFeedbackAdorner.cs
- PreparingEnlistment.cs
- InvokerUtil.cs
- StatusBarPanel.cs
- WorkflowDebuggerSteppingAttribute.cs
- RuntimeHandles.cs
- BindingElementExtensionElement.cs
- WebScriptMetadataInstanceContextProvider.cs
- Marshal.cs
- BatchParser.cs
- InstallerTypeAttribute.cs
- TagMapCollection.cs
- SafeProcessHandle.cs
- WebHttpDispatchOperationSelector.cs
- CheckBoxRenderer.cs
- DES.cs
- WebServiceParameterData.cs
- FormatVersion.cs
- NgenServicingAttributes.cs
- SqlFormatter.cs
- LinkArea.cs
- EncoderReplacementFallback.cs
- CurrentChangingEventManager.cs
- CLSCompliantAttribute.cs
- HtmlTable.cs
- OperationAbortedException.cs
- QilSortKey.cs
- SQLBinary.cs
- CompleteWizardStep.cs
- SecurityPermission.cs
- WizardPanel.cs
- EventHandlersStore.cs
- DateTimeFormat.cs
- Expression.cs
- ImageMetadata.cs
- ConfigsHelper.cs
- XmlAttributeAttribute.cs
- WindowsAltTab.cs
- StrokeDescriptor.cs
- TypeSystem.cs
- WinHttpWebProxyFinder.cs
- RayHitTestParameters.cs
- FullTextLine.cs
- TreeViewItem.cs
- PropertyKey.cs
- Highlights.cs
- AnnotationObservableCollection.cs
- BindingContext.cs
- HttpApplication.cs
- DictionaryGlobals.cs
- TextElementCollection.cs
- OleDbSchemaGuid.cs
- SynchronizedInputPattern.cs
- Matrix3D.cs
- PageOutputColor.cs
- InvalidContentTypeException.cs
- DrawingContextDrawingContextWalker.cs
- DataGridViewCellEventArgs.cs
- Lasso.cs
- VirtualPath.cs
- PointAnimationBase.cs
- ButtonChrome.cs
- ExternalException.cs
- FixedNode.cs
- DataGridItemAutomationPeer.cs
- LineGeometry.cs
- MulticastDelegate.cs
- X509ChainPolicy.cs
- WebPartEditorOkVerb.cs
- XPathConvert.cs
- XmlImplementation.cs
- Root.cs
- TargetInvocationException.cs
- ScrollEventArgs.cs
- DictionarySectionHandler.cs
- PageCatalogPartDesigner.cs
- SystemUnicastIPAddressInformation.cs
- StorageEntityContainerMapping.cs
- PerformanceCounterCategory.cs
- XPathDocumentIterator.cs
- XmlNodeWriter.cs
- SoapIncludeAttribute.cs
- ExpressionNormalizer.cs
- SafeHandles.cs
- SpellerHighlightLayer.cs
- StandardCommands.cs
- BufferModeSettings.cs
- ClientOperation.cs
- ResourcePart.cs
- Utils.cs
- NavigatorInput.cs
- MarkupCompilePass1.cs
- RtfFormatStack.cs
- SelectionEditor.cs