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
- OAVariantLib.cs
- ViewCellRelation.cs
- SerializeAbsoluteContext.cs
- DesignerListAdapter.cs
- DecodeHelper.cs
- RIPEMD160Managed.cs
- PerformanceCounterManager.cs
- FileReservationCollection.cs
- DispatcherExceptionEventArgs.cs
- TextEndOfParagraph.cs
- GridItemPattern.cs
- ParserOptions.cs
- DeflateStream.cs
- TriggerAction.cs
- MetadataPropertyvalue.cs
- StdValidatorsAndConverters.cs
- LambdaValue.cs
- TextElementCollectionHelper.cs
- input.cs
- BasePropertyDescriptor.cs
- DesignerRegionCollection.cs
- Compiler.cs
- SystemIcmpV6Statistics.cs
- PenContexts.cs
- WindowsListViewItemStartMenu.cs
- FamilyMap.cs
- ToolStripSeparatorRenderEventArgs.cs
- ConfigUtil.cs
- DoubleLinkListEnumerator.cs
- ProviderManager.cs
- WebPartEditorApplyVerb.cs
- ContextStaticAttribute.cs
- DataList.cs
- DataFormats.cs
- WebPartVerbCollection.cs
- XmlSchemaDatatype.cs
- sitestring.cs
- LinearGradientBrush.cs
- FormViewModeEventArgs.cs
- WebConfigurationManager.cs
- IODescriptionAttribute.cs
- DataFormat.cs
- DataKeyCollection.cs
- Triplet.cs
- ChannelCredentials.cs
- CodeVariableReferenceExpression.cs
- StringToken.cs
- ExpressionBuilderContext.cs
- InkCollectionBehavior.cs
- BindingBase.cs
- EntityDesignerDataSourceView.cs
- UInt32Converter.cs
- ToolboxItemFilterAttribute.cs
- ViewManagerAttribute.cs
- DateTimeSerializationSection.cs
- DesignOnlyAttribute.cs
- Metafile.cs
- PolicyLevel.cs
- ConnectionPoolManager.cs
- basenumberconverter.cs
- Propagator.JoinPropagator.SubstitutingCloneVisitor.cs
- OperandQuery.cs
- Properties.cs
- FormsAuthenticationModule.cs
- Rect3DConverter.cs
- DetailsViewRowCollection.cs
- SkipQueryOptionExpression.cs
- RegexReplacement.cs
- Accessible.cs
- DataSourceXmlSerializationAttribute.cs
- DbConnectionOptions.cs
- PartitionedDataSource.cs
- CheckBox.cs
- TrackBar.cs
- ImageIndexConverter.cs
- PopupEventArgs.cs
- SingleAnimationUsingKeyFrames.cs
- Hex.cs
- ObjectDataSourceStatusEventArgs.cs
- RoleManagerSection.cs
- CreateUserWizardDesigner.cs
- RowToFieldTransformer.cs
- HorizontalAlignConverter.cs
- MemberListBinding.cs
- XpsFixedPageReaderWriter.cs
- TextTreeDeleteContentUndoUnit.cs
- EndEvent.cs
- Queue.cs
- StateMachineTimers.cs
- SimpleTextLine.cs
- StatusBar.cs
- COM2AboutBoxPropertyDescriptor.cs
- DataSourceProvider.cs
- LocatorPart.cs
- EastAsianLunisolarCalendar.cs
- MD5CryptoServiceProvider.cs
- Form.cs
- OleDbConnectionInternal.cs
- FormatSelectingMessageInspector.cs
- DefaultPerformanceCounters.cs