Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- TransformCollection.cs
- TraceData.cs
- CorrelationManager.cs
- BindingFormattingDialog.cs
- TransactionTraceIdentifier.cs
- Tracer.cs
- QilInvokeEarlyBound.cs
- PointAnimation.cs
- XPathSelectionIterator.cs
- PasswordBox.cs
- BigInt.cs
- CommaDelimitedStringAttributeCollectionConverter.cs
- ConsoleTraceListener.cs
- DescriptionAttribute.cs
- SamlSerializer.cs
- ConfigurationValue.cs
- MediaPlayerState.cs
- MethodCallTranslator.cs
- AliasGenerator.cs
- serverconfig.cs
- Message.cs
- ParameterModifier.cs
- Baml6ConstructorInfo.cs
- SchemaObjectWriter.cs
- StorageComplexPropertyMapping.cs
- DateTimeStorage.cs
- InstalledFontCollection.cs
- UnicastIPAddressInformationCollection.cs
- XmlDataContract.cs
- PassportPrincipal.cs
- BulletedListEventArgs.cs
- MsmqTransportSecurityElement.cs
- XmlRawWriterWrapper.cs
- InstanceDataCollection.cs
- SimpleBitVector32.cs
- ListViewUpdatedEventArgs.cs
- WebPartCatalogAddVerb.cs
- ConnectionManagementElementCollection.cs
- CodeActivityContext.cs
- MarkupProperty.cs
- SimpleLine.cs
- VerificationAttribute.cs
- OracleCommand.cs
- AspNetSynchronizationContext.cs
- XmlNullResolver.cs
- WindowsRebar.cs
- XsdCachingReader.cs
- IsolatedStorageFileStream.cs
- RadioButton.cs
- ControlAdapter.cs
- InvokePattern.cs
- DbExpressionBuilder.cs
- UnmanagedMarshal.cs
- BrowserCapabilitiesFactory.cs
- Popup.cs
- CompilationSection.cs
- EventPrivateKey.cs
- TextRangeAdaptor.cs
- CompositeDataBoundControl.cs
- SoapCodeExporter.cs
- Cursor.cs
- WeakReferenceKey.cs
- FileFormatException.cs
- PointConverter.cs
- BitmapMetadataBlob.cs
- CodeArrayCreateExpression.cs
- DigitShape.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- ObjectDataSource.cs
- XamlTypeMapper.cs
- DecimalStorage.cs
- ApplicationServicesHostFactory.cs
- COM2PropertyBuilderUITypeEditor.cs
- XmlSchemaAttributeGroup.cs
- ThemeDirectoryCompiler.cs
- DataGridViewCellStyleConverter.cs
- XmlNodeReader.cs
- ObjectDataSourceView.cs
- WebPartZoneCollection.cs
- PropertyItem.cs
- XhtmlBasicLiteralTextAdapter.cs
- XmlObjectSerializerReadContextComplex.cs
- HwndMouseInputProvider.cs
- TextTreeInsertUndoUnit.cs
- PropertyNames.cs
- DataBoundControl.cs
- SafeNativeMethods.cs
- VerticalAlignConverter.cs
- ViewKeyConstraint.cs
- RangeValueProviderWrapper.cs
- TreeNode.cs
- InfiniteTimeSpanConverter.cs
- QuestionEventArgs.cs
- UIElement3D.cs
- WebReference.cs
- BasePattern.cs
- DispatcherObject.cs
- Funcletizer.cs
- TrackBarDesigner.cs
- GeneralTransform2DTo3D.cs