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
- XmlSchemaAttribute.cs
- KoreanLunisolarCalendar.cs
- TypeElement.cs
- NamespaceCollection.cs
- DetailsViewDeletedEventArgs.cs
- GlyphingCache.cs
- DayRenderEvent.cs
- HttpCapabilitiesBase.cs
- NullableConverter.cs
- ResourceLoader.cs
- UInt16Storage.cs
- TypedTableBase.cs
- WindowsUpDown.cs
- SignedInfo.cs
- SafeTimerHandle.cs
- BrushProxy.cs
- UserControlAutomationPeer.cs
- SaveFileDialogDesigner.cs
- DiagnosticsConfigurationHandler.cs
- SoapFormatterSinks.cs
- DBCommand.cs
- PageBorderless.cs
- ByteRangeDownloader.cs
- TextEvent.cs
- WebBrowserPermission.cs
- AdjustableArrowCap.cs
- ZipIOLocalFileBlock.cs
- PageContentCollection.cs
- Int16KeyFrameCollection.cs
- RC2.cs
- FormatConvertedBitmap.cs
- EntityDataSourceWrapper.cs
- ReverseInheritProperty.cs
- XmlSerializer.cs
- AssemblyHash.cs
- EdmToObjectNamespaceMap.cs
- SecurityRuntime.cs
- MissingMemberException.cs
- XXXOnTypeBuilderInstantiation.cs
- TraceSection.cs
- D3DImage.cs
- SafeNativeMethods.cs
- ToolStripPanelDesigner.cs
- XPathDocumentIterator.cs
- CounterCreationDataCollection.cs
- XmlSchemaSimpleContentRestriction.cs
- EntryWrittenEventArgs.cs
- RenderDataDrawingContext.cs
- RecognizedWordUnit.cs
- AssemblyResourceLoader.cs
- DbConnectionInternal.cs
- TextOptionsInternal.cs
- UpdateManifestForBrowserApplication.cs
- WindowsToolbarItemAsMenuItem.cs
- PackageRelationshipCollection.cs
- MediaContext.cs
- ProbeDuplexCD1AsyncResult.cs
- FormsAuthenticationCredentials.cs
- FlagsAttribute.cs
- XamlTreeBuilder.cs
- FixedDocumentSequencePaginator.cs
- StylusDevice.cs
- ArrayExtension.cs
- SimpleWorkerRequest.cs
- MessageRpc.cs
- SqlTypeConverter.cs
- ColorConvertedBitmapExtension.cs
- Helpers.cs
- HandlerMappingMemo.cs
- MaskedTextBox.cs
- LayoutUtils.cs
- TextRangeEditLists.cs
- SystemException.cs
- SqlProvider.cs
- RegexNode.cs
- ObjectFullSpanRewriter.cs
- ConfigurationLocationCollection.cs
- ModelPropertyCollectionImpl.cs
- TdsRecordBufferSetter.cs
- RegexStringValidator.cs
- KeyProperty.cs
- SpeakInfo.cs
- FixedSOMContainer.cs
- FactoryGenerator.cs
- MultiDataTrigger.cs
- ToolStripScrollButton.cs
- DataGridViewButtonColumn.cs
- ApplicationInterop.cs
- DocumentViewerHelper.cs
- TrustVersion.cs
- EntityConnectionStringBuilderItem.cs
- OdbcConnectionString.cs
- DbUpdateCommandTree.cs
- Popup.cs
- WebPartCancelEventArgs.cs
- AudioStateChangedEventArgs.cs
- ConnectivityStatus.cs
- NodeFunctions.cs
- DesignerLabelAdapter.cs
- Point4D.cs