Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- AppDomainFactory.cs
- CoreSwitches.cs
- SerialStream.cs
- BookmarkEventArgs.cs
- LifetimeServices.cs
- Function.cs
- ElementMarkupObject.cs
- ADRoleFactoryConfiguration.cs
- XmlMembersMapping.cs
- Converter.cs
- UnSafeCharBuffer.cs
- XmlSchemaInclude.cs
- ProcessHostMapPath.cs
- LoadWorkflowByKeyAsyncResult.cs
- SystemDropShadowChrome.cs
- RepeatButtonAutomationPeer.cs
- QilUnary.cs
- ObjectDataSourceSelectingEventArgs.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- ExceptionUtility.cs
- TextSegment.cs
- SqlDependencyUtils.cs
- TextControlDesigner.cs
- NoResizeHandleGlyph.cs
- QueryUtil.cs
- Substitution.cs
- XmlSerializerObjectSerializer.cs
- CompilationSection.cs
- webclient.cs
- LogExtent.cs
- BooleanStorage.cs
- GeneralTransform3D.cs
- Html32TextWriter.cs
- SystemBrushes.cs
- OrthographicCamera.cs
- ExternalException.cs
- DbConnectionFactory.cs
- WebPartMenu.cs
- AddIn.cs
- Grant.cs
- TextBox.cs
- StateMachineTimers.cs
- WebBodyFormatMessageProperty.cs
- BitVector32.cs
- WebContentFormatHelper.cs
- Misc.cs
- ErasingStroke.cs
- COM2IDispatchConverter.cs
- ArrowControl.xaml.cs
- DataMember.cs
- XmlWriterDelegator.cs
- ApplicationBuildProvider.cs
- FixUpCollection.cs
- SqlTriggerContext.cs
- GeometryCollection.cs
- ThreadExceptionDialog.cs
- TreeWalker.cs
- EntityDataSourceUtil.cs
- RenderOptions.cs
- Conditional.cs
- ForeignKeyConstraint.cs
- ApplicationDirectory.cs
- ToolStripDropDownButton.cs
- HScrollProperties.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- CharStorage.cs
- PassportAuthenticationModule.cs
- DbgUtil.cs
- StatusBarItemAutomationPeer.cs
- PageCache.cs
- XmlTextReaderImplHelpers.cs
- ReadOnlyNameValueCollection.cs
- RecognizedPhrase.cs
- safemediahandle.cs
- PersianCalendar.cs
- FileEnumerator.cs
- SqlMetaData.cs
- QualifiedId.cs
- DbBuffer.cs
- XLinq.cs
- _Events.cs
- BindingNavigator.cs
- ProcessModelSection.cs
- DetailsViewDesigner.cs
- _LoggingObject.cs
- TabControlCancelEvent.cs
- ResourceAttributes.cs
- ResourceDictionary.cs
- JsonObjectDataContract.cs
- EventItfInfo.cs
- ObjectHelper.cs
- PowerModeChangedEventArgs.cs
- IPipelineRuntime.cs
- WebPartCancelEventArgs.cs
- CellTreeNodeVisitors.cs
- DeleteIndexBinder.cs
- ValidationError.cs
- WSSecurityOneDotOneSendSecurityHeader.cs
- OutArgument.cs
- BindingManagerDataErrorEventArgs.cs