Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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() { } } } // 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
- ToolStripItemDesigner.cs
- BindingBase.cs
- EntityDataSource.cs
- SharedTcpTransportManager.cs
- Predicate.cs
- TransactionManager.cs
- SystemColors.cs
- CompositionAdorner.cs
- ClientTargetCollection.cs
- ImageConverter.cs
- CodeCompiler.cs
- MouseOverProperty.cs
- UriTemplateEquivalenceComparer.cs
- PolicyManager.cs
- SystemThemeKey.cs
- DataGridViewRowCollection.cs
- SharedRuntimeState.cs
- XmlText.cs
- Pointer.cs
- HtmlElementErrorEventArgs.cs
- SafeFindHandle.cs
- CacheDependency.cs
- SQLBinary.cs
- VirtualPathData.cs
- DynamicRendererThreadManager.cs
- DataAdapter.cs
- TypeContext.cs
- XmlReader.cs
- Grid.cs
- WindowsSysHeader.cs
- TerminateSequenceResponse.cs
- CompiledRegexRunnerFactory.cs
- XmlSchemaException.cs
- DependencyObjectPropertyDescriptor.cs
- ExclusiveCanonicalizationTransform.cs
- GridViewUpdatedEventArgs.cs
- TrustSection.cs
- ToolStripControlHost.cs
- ComPlusThreadInitializer.cs
- MasterPageCodeDomTreeGenerator.cs
- ClientSettingsSection.cs
- XD.cs
- SvcMapFile.cs
- Form.cs
- Operators.cs
- NameScopePropertyAttribute.cs
- StorageEntityTypeMapping.cs
- EnterpriseServicesHelper.cs
- Label.cs
- GeometryValueSerializer.cs
- Peer.cs
- TableCellAutomationPeer.cs
- WebPartCatalogCloseVerb.cs
- DependencyObjectType.cs
- RC2.cs
- BufferBuilder.cs
- LinqDataSourceHelper.cs
- PropertyInformationCollection.cs
- _HeaderInfo.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- XslTransform.cs
- XmlILOptimizerVisitor.cs
- WindowsSecurityTokenAuthenticator.cs
- ItemCollection.cs
- BadImageFormatException.cs
- DataPointer.cs
- MenuCommandsChangedEventArgs.cs
- BindingValueChangedEventArgs.cs
- COM2ColorConverter.cs
- IgnoreFileBuildProvider.cs
- XPathBuilder.cs
- WhitespaceSignificantCollectionAttribute.cs
- RenamedEventArgs.cs
- CompilerTypeWithParams.cs
- DBSqlParserColumnCollection.cs
- MatrixUtil.cs
- Renderer.cs
- EventDescriptor.cs
- Invariant.cs
- CompilerErrorCollection.cs
- TemplatedMailWebEventProvider.cs
- SimpleMailWebEventProvider.cs
- _OSSOCK.cs
- ServerReliableChannelBinder.cs
- BrowserCapabilitiesFactory.cs
- NotifyCollectionChangedEventArgs.cs
- FixedHyperLink.cs
- DataGridViewCellLinkedList.cs
- StreamWithDictionary.cs
- CreateUserWizardDesigner.cs
- TextBoxBase.cs
- TransformGroup.cs
- ReplyChannelAcceptor.cs
- ModelServiceImpl.cs
- _RequestLifetimeSetter.cs
- ColumnBinding.cs
- QueryStringConverter.cs
- ValueQuery.cs
- TabControl.cs
- ListView.cs