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
- DataGridItemCollection.cs
- ActiveDocumentEvent.cs
- DetailsViewInsertEventArgs.cs
- WsdlInspector.cs
- TableLayoutPanelCodeDomSerializer.cs
- xdrvalidator.cs
- LinkLabelLinkClickedEvent.cs
- IndexedEnumerable.cs
- DictionaryEntry.cs
- GenericWebPart.cs
- QuotedPrintableStream.cs
- MissingMemberException.cs
- FrameDimension.cs
- SqlEnums.cs
- ListItemParagraph.cs
- NamedPipeHostedTransportConfiguration.cs
- Internal.cs
- XmlSchemaParticle.cs
- AbstractExpressions.cs
- FlowPanelDesigner.cs
- TypeNameConverter.cs
- ToolStripRenderEventArgs.cs
- AutomationPropertyInfo.cs
- PopupRoot.cs
- AsymmetricCryptoHandle.cs
- FormViewPageEventArgs.cs
- HtmlToClrEventProxy.cs
- TableAutomationPeer.cs
- DesignerLoader.cs
- ShaderEffect.cs
- ForEachAction.cs
- BindableAttribute.cs
- InternalTypeHelper.cs
- TextShapeableCharacters.cs
- QuadraticBezierSegment.cs
- IListConverters.cs
- ExtendedProperty.cs
- RichTextBox.cs
- Label.cs
- AstNode.cs
- ImageMetadata.cs
- XmlSchemaComplexContent.cs
- EntityStoreSchemaFilterEntry.cs
- ApplicationTrust.cs
- wgx_render.cs
- RecordConverter.cs
- DBConnectionString.cs
- PenThreadPool.cs
- XmlSchemaSimpleContent.cs
- AccessViolationException.cs
- DeflateStream.cs
- AspNetSynchronizationContext.cs
- WizardStepCollectionEditor.cs
- DateTimeFormatInfoScanner.cs
- CodeAccessPermission.cs
- ProfileManager.cs
- BaseDataListPage.cs
- CompiledIdentityConstraint.cs
- CachedRequestParams.cs
- DPAPIProtectedConfigurationProvider.cs
- CompiledELinqQueryState.cs
- TextRunProperties.cs
- GetWinFXPath.cs
- SafeThreadHandle.cs
- CompensateDesigner.cs
- EntityClientCacheKey.cs
- XamlDesignerSerializationManager.cs
- TraceFilter.cs
- TextEmbeddedObject.cs
- GeometryConverter.cs
- HashAlgorithm.cs
- comcontractssection.cs
- ErrorRuntimeConfig.cs
- SqlDependencyUtils.cs
- UnitySerializationHolder.cs
- StrokeCollectionConverter.cs
- TextShapeableCharacters.cs
- CodeTypeDelegate.cs
- UnsettableComboBox.cs
- FillRuleValidation.cs
- ColumnMapCopier.cs
- DoubleAnimation.cs
- AnonymousIdentificationModule.cs
- SubMenuStyleCollection.cs
- DirectoryObjectSecurity.cs
- WebPartDeleteVerb.cs
- PlainXmlSerializer.cs
- ClientConfigurationHost.cs
- SmiEventStream.cs
- MouseOverProperty.cs
- MasterPage.cs
- TargetControlTypeAttribute.cs
- AbsoluteQuery.cs
- ExtensionDataObject.cs
- RepeaterCommandEventArgs.cs
- Identity.cs
- SkinBuilder.cs
- TextElementEnumerator.cs
- DrawingCollection.cs
- MobileContainerDesigner.cs