Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- PointLightBase.cs
- SchemaImporter.cs
- Membership.cs
- BinaryMessageEncodingElement.cs
- TextCompositionManager.cs
- PinnedBufferMemoryStream.cs
- BlockCollection.cs
- StrokeCollectionDefaultValueFactory.cs
- TypeDelegator.cs
- CriticalExceptions.cs
- IncrementalReadDecoders.cs
- ResourceDescriptionAttribute.cs
- ReaderWriterLock.cs
- WebServiceErrorEvent.cs
- ObjectStateEntryDbDataRecord.cs
- StringComparer.cs
- PowerStatus.cs
- GradientBrush.cs
- GlyphRunDrawing.cs
- SessionStateModule.cs
- OleDbReferenceCollection.cs
- IsolatedStorageFileStream.cs
- SafeLibraryHandle.cs
- RequestUriProcessor.cs
- ManagementOptions.cs
- SoapFault.cs
- EmbossBitmapEffect.cs
- PersonalizationProviderHelper.cs
- CngProvider.cs
- Item.cs
- CaseStatementSlot.cs
- DesignUtil.cs
- QueryRewriter.cs
- HwndProxyElementProvider.cs
- RequestBringIntoViewEventArgs.cs
- ADMembershipProvider.cs
- SvcMapFileSerializer.cs
- DynamicPropertyHolder.cs
- ObjectCacheHost.cs
- SelectedDatesCollection.cs
- BamlTreeMap.cs
- SByte.cs
- Hash.cs
- newinstructionaction.cs
- TimeZone.cs
- XPathChildIterator.cs
- ConstantSlot.cs
- SqlServices.cs
- XsltArgumentList.cs
- EncryptedKeyIdentifierClause.cs
- SubpageParaClient.cs
- MessageLoggingElement.cs
- InvocationExpression.cs
- AutomationElementCollection.cs
- Int32Rect.cs
- Soap.cs
- ValidateNames.cs
- RuleSetDialog.cs
- ProtectedProviderSettings.cs
- PolyLineSegment.cs
- SecurityMode.cs
- TextPointerBase.cs
- InstancePersistenceException.cs
- FrameworkContentElement.cs
- Margins.cs
- XmlTextAttribute.cs
- InvokeMemberBinder.cs
- MsmqChannelFactory.cs
- HelloOperation11AsyncResult.cs
- ToolStripDropDown.cs
- InkCanvas.cs
- SessionEndingCancelEventArgs.cs
- TypedLocationWrapper.cs
- FormViewInsertedEventArgs.cs
- DataControlFieldHeaderCell.cs
- StrokeCollectionConverter.cs
- ArgumentOutOfRangeException.cs
- EntityObject.cs
- SingleStorage.cs
- HyperLink.cs
- InnerItemCollectionView.cs
- AttributeCollection.cs
- EntityTemplateUserControl.cs
- BitFlagsGenerator.cs
- Compiler.cs
- BrowserCapabilitiesFactoryBase.cs
- ButtonField.cs
- DataGridViewSortCompareEventArgs.cs
- WorkflowControlClient.cs
- Registry.cs
- Debug.cs
- DesignerListAdapter.cs
- WorkflowMarkupSerializationManager.cs
- IItemContainerGenerator.cs
- MulticastOption.cs
- AnimationClockResource.cs
- SettingsContext.cs
- SelectionPattern.cs
- DocumentViewerBase.cs
- hwndwrapper.cs