Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / 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. //------------------------------------------------------------------------------ //// 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XMLSchema.cs
- PolyQuadraticBezierSegmentFigureLogic.cs
- EventRoute.cs
- RemoteWebConfigurationHostStream.cs
- TemplateControl.cs
- XmlLanguageConverter.cs
- VisualStyleRenderer.cs
- TextRenderingModeValidation.cs
- OdbcInfoMessageEvent.cs
- DateTimeStorage.cs
- Win32Native.cs
- ADMembershipProvider.cs
- MDIControlStrip.cs
- DirectoryLocalQuery.cs
- HMACMD5.cs
- DropShadowEffect.cs
- M3DUtil.cs
- DynamicPropertyHolder.cs
- _NegotiateClient.cs
- SystemTcpStatistics.cs
- Compiler.cs
- TraceInternal.cs
- PropertyRecord.cs
- ComponentRenameEvent.cs
- ChannelBinding.cs
- PixelFormats.cs
- HttpHandler.cs
- Component.cs
- AppDomainFactory.cs
- HttpCookieCollection.cs
- ScriptingJsonSerializationSection.cs
- CacheMemory.cs
- WebContentFormatHelper.cs
- sitestring.cs
- ListViewGroupConverter.cs
- ToolStripItemImageRenderEventArgs.cs
- SqlColumnizer.cs
- ControllableStoryboardAction.cs
- VisualStyleRenderer.cs
- ReliabilityContractAttribute.cs
- X509SecurityTokenAuthenticator.cs
- Effect.cs
- EllipticalNodeOperations.cs
- GenericUriParser.cs
- SupportingTokenAuthenticatorSpecification.cs
- WebBrowser.cs
- WebPartConnectionCollection.cs
- SqlCommand.cs
- TextEffectCollection.cs
- AsyncPostBackErrorEventArgs.cs
- DynamicValueConverter.cs
- TextBoxBase.cs
- TransactionOptions.cs
- NativeMethods.cs
- XmlMembersMapping.cs
- XmlTextAttribute.cs
- Profiler.cs
- URI.cs
- SiteMembershipCondition.cs
- CLRBindingWorker.cs
- AnnotationService.cs
- BooleanProjectedSlot.cs
- ActivityCodeDomReferenceService.cs
- Int32RectValueSerializer.cs
- RoleServiceManager.cs
- UIElement3D.cs
- IisTraceWebEventProvider.cs
- AdapterUtil.cs
- StdValidatorsAndConverters.cs
- SchemaElementDecl.cs
- CommonServiceBehaviorElement.cs
- Label.cs
- ObjectDataSourceDisposingEventArgs.cs
- QilLoop.cs
- PagerStyle.cs
- KnownColorTable.cs
- TcpStreams.cs
- ToolStripContentPanelRenderEventArgs.cs
- validation.cs
- ReadOnlyDataSourceView.cs
- SQLDouble.cs
- PropertyIDSet.cs
- RegexCode.cs
- DateTimeUtil.cs
- MouseGestureConverter.cs
- CurrencyManager.cs
- TypeConverterHelper.cs
- ControlType.cs
- IntMinMaxAggregationOperator.cs
- HtmlTableRowCollection.cs
- ValueExpressions.cs
- TextRangeSerialization.cs
- ClientConfigurationSystem.cs
- WebBaseEventKeyComparer.cs
- CodeActivityContext.cs
- DomNameTable.cs
- EventSourceCreationData.cs
- EntityKeyElement.cs
- FilterableData.cs
- SemanticTag.cs