Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / 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. //------------------------------------------------------------------------------ //// 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- MissingFieldException.cs
- Events.cs
- ListItemCollection.cs
- LazyTextWriterCreator.cs
- IResourceProvider.cs
- FieldDescriptor.cs
- NativeMethods.cs
- IncrementalReadDecoders.cs
- XhtmlBasicLinkAdapter.cs
- QilLiteral.cs
- VersionUtil.cs
- Library.cs
- SchemaNamespaceManager.cs
- StyleCollectionEditor.cs
- XomlDesignerLoader.cs
- NumericExpr.cs
- InheritanceContextChangedEventManager.cs
- DataGridViewBindingCompleteEventArgs.cs
- TransactionInterop.cs
- TableLayoutSettings.cs
- CroppedBitmap.cs
- FocusWithinProperty.cs
- StringCollectionMarkupSerializer.cs
- SpeechEvent.cs
- AbstractDataSvcMapFileLoader.cs
- Camera.cs
- CheckBox.cs
- BaseDataList.cs
- MachineKeyConverter.cs
- Int32AnimationBase.cs
- PerformanceCounterPermissionEntry.cs
- ToolStripPanelRow.cs
- FixedDocumentSequencePaginator.cs
- EventLogHandle.cs
- TraceListeners.cs
- CodeRemoveEventStatement.cs
- ExpandoClass.cs
- RedistVersionInfo.cs
- SharedDp.cs
- HtmlLabelAdapter.cs
- EndpointBehaviorElementCollection.cs
- DoubleLinkList.cs
- ProgressBarHighlightConverter.cs
- CoTaskMemHandle.cs
- LogicalExpr.cs
- DesignerToolStripControlHost.cs
- StickyNoteAnnotations.cs
- SafeArrayRankMismatchException.cs
- EmissiveMaterial.cs
- TrackingServices.cs
- NameTable.cs
- LineGeometry.cs
- StyleModeStack.cs
- QueryContinueDragEvent.cs
- CustomAssemblyResolver.cs
- precedingquery.cs
- SystemWebSectionGroup.cs
- Roles.cs
- WebPartHelpVerb.cs
- dataSvcMapFileLoader.cs
- HeaderedContentControl.cs
- PrimaryKeyTypeConverter.cs
- StickyNoteContentControl.cs
- InitializerFacet.cs
- Identity.cs
- LinkClickEvent.cs
- TripleDESCryptoServiceProvider.cs
- ContourSegment.cs
- AuthenticationModuleElement.cs
- PropertyKey.cs
- XmlSerializer.cs
- ColorConverter.cs
- FormatStringEditor.cs
- ServerReliableChannelBinder.cs
- System.Data_BID.cs
- FieldTemplateUserControl.cs
- UpdatePanel.cs
- VirtualizingPanel.cs
- CompoundFileReference.cs
- LogArchiveSnapshot.cs
- BevelBitmapEffect.cs
- ISCIIEncoding.cs
- ProcessInfo.cs
- tooltip.cs
- DataControlFieldHeaderCell.cs
- SoapCodeExporter.cs
- ResourceSet.cs
- FastPropertyAccessor.cs
- ToolStripItemCollection.cs
- GenericTypeParameterConverter.cs
- SmtpMail.cs
- DiscoveryMessageSequence.cs
- SoapFaultCodes.cs
- OperationCanceledException.cs
- RegistryKey.cs
- MessageDecoder.cs
- Ref.cs
- CompleteWizardStep.cs
- EntityDataSourceColumn.cs
- SwitchAttribute.cs