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
- HttpGetClientProtocol.cs
- Screen.cs
- DataKey.cs
- XmlSchemaInfo.cs
- OperationInvokerTrace.cs
- PrinterResolution.cs
- XmlSchemaExporter.cs
- ParameterBuilder.cs
- MonitorWrapper.cs
- AlphabetConverter.cs
- UrlPath.cs
- ApplicationHost.cs
- SetMemberBinder.cs
- WebPartConnectionsCloseVerb.cs
- StateManagedCollection.cs
- ReplyChannel.cs
- BindingExpressionBase.cs
- XmlDigitalSignatureProcessor.cs
- ActiveXMessageFormatter.cs
- StructuralCache.cs
- AnonymousIdentificationModule.cs
- HttpSessionStateBase.cs
- DataObjectFieldAttribute.cs
- ValueOfAction.cs
- Effect.cs
- NetTcpBinding.cs
- RegexNode.cs
- PerspectiveCamera.cs
- UIElementCollection.cs
- DependencyPropertyValueSerializer.cs
- TransformGroup.cs
- WSMessageEncoding.cs
- Evaluator.cs
- ContainerVisual.cs
- UserMapPath.cs
- ConsoleEntryPoint.cs
- ProcessThreadCollection.cs
- EtwProvider.cs
- ArgumentException.cs
- SizeFConverter.cs
- QilScopedVisitor.cs
- WebRequestModulesSection.cs
- TextContainerChangeEventArgs.cs
- InvalidPropValue.cs
- DecimalKeyFrameCollection.cs
- ServiceObjectContainer.cs
- RSAOAEPKeyExchangeFormatter.cs
- MultilineStringEditor.cs
- List.cs
- Graphics.cs
- DBSchemaTable.cs
- XmlSerializationReader.cs
- Literal.cs
- DrawListViewItemEventArgs.cs
- KnownTypesHelper.cs
- ToolStrip.cs
- ValidationEventArgs.cs
- ExceptionUtility.cs
- Storyboard.cs
- TableCellCollection.cs
- DesignerCategoryAttribute.cs
- ActivationWorker.cs
- SelectedDatesCollection.cs
- AudioLevelUpdatedEventArgs.cs
- SchemaLookupTable.cs
- CursorConverter.cs
- MimeTypeAttribute.cs
- MenuAutomationPeer.cs
- DataGridViewElement.cs
- SessionEndedEventArgs.cs
- _ChunkParse.cs
- ButtonFieldBase.cs
- Types.cs
- StylusSystemGestureEventArgs.cs
- SafeNativeMethods.cs
- AssemblyAssociatedContentFileAttribute.cs
- thaishape.cs
- ReadOnlyHierarchicalDataSource.cs
- EventLogHandle.cs
- SqlStatistics.cs
- StructuredType.cs
- DataServiceResponse.cs
- GenerateTemporaryTargetAssembly.cs
- TrackBarRenderer.cs
- BinaryReader.cs
- OpenTypeLayout.cs
- CustomAttributeBuilder.cs
- KeyValuePairs.cs
- _Events.cs
- CharAnimationUsingKeyFrames.cs
- XmlArrayItemAttributes.cs
- ArrayConverter.cs
- FactoryGenerator.cs
- AssemblyAttributes.cs
- CollectionViewProxy.cs
- Image.cs
- PagerSettings.cs
- AuthenticationConfig.cs
- BuildManager.cs
- XmlComplianceUtil.cs