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
- DataRelation.cs
- StringFormat.cs
- LayoutTable.cs
- ValidationService.cs
- DataServiceQuery.cs
- XmlReflectionMember.cs
- DynamicILGenerator.cs
- CaseInsensitiveHashCodeProvider.cs
- SkinIDTypeConverter.cs
- XmlChildNodes.cs
- FileDialogCustomPlacesCollection.cs
- DataControlImageButton.cs
- DbInsertCommandTree.cs
- ObjectFullSpanRewriter.cs
- CompilerWrapper.cs
- StyleXamlParser.cs
- GorillaCodec.cs
- PermissionSetEnumerator.cs
- VectorAnimationBase.cs
- DataGridClipboardCellContent.cs
- InputProcessorProfiles.cs
- XPathBuilder.cs
- EpmSourceTree.cs
- ClockController.cs
- TimeoutConverter.cs
- Int32Animation.cs
- XmlCustomFormatter.cs
- ContextMenu.cs
- IntSecurity.cs
- BehaviorDragDropEventArgs.cs
- PostBackOptions.cs
- ContractUtils.cs
- SiteMapNode.cs
- SqlBinder.cs
- WebPart.cs
- SqlDependencyListener.cs
- ImageInfo.cs
- Figure.cs
- Win32MouseDevice.cs
- FrugalMap.cs
- GridItemProviderWrapper.cs
- HierarchicalDataSourceControl.cs
- TraceLevelStore.cs
- wpf-etw.cs
- odbcmetadatacolumnnames.cs
- TextDecoration.cs
- HtmlTableRowCollection.cs
- DataQuery.cs
- ExtendedPropertyCollection.cs
- EdmSchemaAttribute.cs
- ZeroOpNode.cs
- RelationalExpressions.cs
- TextServicesPropertyRanges.cs
- Globals.cs
- XmlEntityReference.cs
- PowerStatus.cs
- AccessDataSourceDesigner.cs
- PropertyDescriptorGridEntry.cs
- ObjectContextServiceProvider.cs
- NavigationWindow.cs
- JsonFormatGeneratorStatics.cs
- PropertyGridEditorPart.cs
- SmiSettersStream.cs
- TableTextElementCollectionInternal.cs
- FrameSecurityDescriptor.cs
- OrderedDictionary.cs
- ServiceCredentialsElement.cs
- ModelItemImpl.cs
- AuditLevel.cs
- HttpCapabilitiesBase.cs
- TableLayoutPanel.cs
- ScrollItemProviderWrapper.cs
- AvTraceDetails.cs
- SectionVisual.cs
- SafeRegistryHandle.cs
- TextCollapsingProperties.cs
- SparseMemoryStream.cs
- DataColumnMapping.cs
- CssClassPropertyAttribute.cs
- Calendar.cs
- WebPartUserCapability.cs
- HttpHeaderCollection.cs
- OperationGenerator.cs
- DocComment.cs
- HtmlControl.cs
- RemotingException.cs
- AttributeEmitter.cs
- datacache.cs
- DynamicPropertyHolder.cs
- Renderer.cs
- X509Extension.cs
- HtmlInputSubmit.cs
- Identifier.cs
- DefaultSection.cs
- SecurityCriticalDataForSet.cs
- BoolLiteral.cs
- ExtensionSurface.cs
- SqlDataSourceSelectingEventArgs.cs
- GeneratedView.cs
- TextEditorTyping.cs