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
- LoginView.cs
- ProfileGroupSettingsCollection.cs
- ProvidersHelper.cs
- EntityTypeBase.cs
- MetadataItem.cs
- WebFormsRootDesigner.cs
- PassportAuthenticationModule.cs
- Splitter.cs
- TreeIterators.cs
- WorkflowExecutor.cs
- TextServicesManager.cs
- TableLayout.cs
- RSAProtectedConfigurationProvider.cs
- DodSequenceMerge.cs
- PagerSettings.cs
- EntityDataSourceValidationException.cs
- TextTreeInsertUndoUnit.cs
- MasterPage.cs
- XsltFunctions.cs
- Label.cs
- WindowProviderWrapper.cs
- XmlSchemaInclude.cs
- SyndicationElementExtensionCollection.cs
- SoapHeaders.cs
- _CookieModule.cs
- BitmapSource.cs
- BaseProcessor.cs
- ServicePointManager.cs
- MemoryRecordBuffer.cs
- GiveFeedbackEventArgs.cs
- UseAttributeSetsAction.cs
- ConstNode.cs
- Bidi.cs
- TemplatePropertyEntry.cs
- SynchronizedChannelCollection.cs
- EdmMember.cs
- RangeValueProviderWrapper.cs
- ProxyElement.cs
- ConvertEvent.cs
- DataListItem.cs
- HtmlControlAdapter.cs
- DataColumn.cs
- entitydatasourceentitysetnameconverter.cs
- DataTableReader.cs
- SiteMapDesignerDataSourceView.cs
- PathFigureCollectionConverter.cs
- QueryOperationResponseOfT.cs
- RSAOAEPKeyExchangeDeformatter.cs
- WindowVisualStateTracker.cs
- Scripts.cs
- UIPermission.cs
- SystemMulticastIPAddressInformation.cs
- XLinq.cs
- BufferedGraphics.cs
- LicenseManager.cs
- DateTimeStorage.cs
- CapabilitiesAssignment.cs
- SchemaImporterExtensionElementCollection.cs
- CompoundFileDeflateTransform.cs
- ListBoxItemAutomationPeer.cs
- JapaneseLunisolarCalendar.cs
- FloaterBaseParagraph.cs
- FileDialog.cs
- DataRowView.cs
- followingsibling.cs
- StringExpressionSet.cs
- ProcessDesigner.cs
- DbgUtil.cs
- AuthenticationException.cs
- Pen.cs
- ArrayItemReference.cs
- ToolStripSeparatorRenderEventArgs.cs
- LocatorManager.cs
- CharacterBuffer.cs
- MimeWriter.cs
- xsdvalidator.cs
- EastAsianLunisolarCalendar.cs
- RegistryExceptionHelper.cs
- SqlVersion.cs
- QueryOperationResponseOfT.cs
- XmlSchemaInclude.cs
- CustomValidator.cs
- SchemaElement.cs
- WindowExtensionMethods.cs
- IncrementalHitTester.cs
- Duration.cs
- MarkupProperty.cs
- RefType.cs
- TextBoxDesigner.cs
- Pointer.cs
- FixedTextSelectionProcessor.cs
- ArglessEventHandlerProxy.cs
- Win32KeyboardDevice.cs
- ToolStripLabel.cs
- XmlSchemaComplexContentRestriction.cs
- PanelStyle.cs
- DataServiceProcessingPipelineEventArgs.cs
- FormViewUpdateEventArgs.cs
- FileLogRecordHeader.cs
- CurrencyManager.cs