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
- DataSourceView.cs
- _LazyAsyncResult.cs
- CryptoApi.cs
- AdornerLayer.cs
- SHA256CryptoServiceProvider.cs
- SqlParameterCollection.cs
- DispatcherHookEventArgs.cs
- FileLogRecordHeader.cs
- ThreadStartException.cs
- TextEditorCopyPaste.cs
- BrowsableAttribute.cs
- OdbcEnvironment.cs
- BatchParser.cs
- SaveFileDialogDesigner.cs
- SystemResourceKey.cs
- MetadataSection.cs
- MobileCategoryAttribute.cs
- DataGridViewTextBoxColumn.cs
- Pointer.cs
- loginstatus.cs
- MenuAutomationPeer.cs
- LifetimeServices.cs
- DecoderFallback.cs
- SignatureHelper.cs
- IpcManager.cs
- AdCreatedEventArgs.cs
- ProxyManager.cs
- DataRecordInternal.cs
- SystemPens.cs
- PreservationFileWriter.cs
- TextEndOfSegment.cs
- ProcessModule.cs
- BitStack.cs
- TextServicesDisplayAttributePropertyRanges.cs
- MergePropertyDescriptor.cs
- ModelItemKeyValuePair.cs
- Schema.cs
- HostingEnvironmentException.cs
- DesignColumn.cs
- LostFocusEventManager.cs
- NameObjectCollectionBase.cs
- MaskInputRejectedEventArgs.cs
- CommandHelpers.cs
- SqlError.cs
- RemoveFromCollection.cs
- bidPrivateBase.cs
- ErrorHandlingReceiver.cs
- EntityClientCacheKey.cs
- InheritanceAttribute.cs
- Internal.cs
- RangeValuePattern.cs
- SymDocumentType.cs
- SoapHttpTransportImporter.cs
- SchemaObjectWriter.cs
- CanExecuteRoutedEventArgs.cs
- Configuration.cs
- Ref.cs
- Int32AnimationUsingKeyFrames.cs
- HtmlElementEventArgs.cs
- ResourceCategoryAttribute.cs
- ISSmlParser.cs
- GridViewColumnCollectionChangedEventArgs.cs
- StatusBarPanelClickEvent.cs
- ScriptRef.cs
- BitmapScalingModeValidation.cs
- ImplicitInputBrush.cs
- ConnectionsZone.cs
- DefaultSerializationProviderAttribute.cs
- ButtonBase.cs
- ZipIOFileItemStream.cs
- TreeNodeBindingCollection.cs
- CoTaskMemHandle.cs
- LassoHelper.cs
- CalendarSelectionChangedEventArgs.cs
- TextEditorContextMenu.cs
- DetailsViewDeleteEventArgs.cs
- PreProcessor.cs
- FileSystemWatcher.cs
- StylusOverProperty.cs
- MailAddress.cs
- DataGridViewElement.cs
- SqlTriggerContext.cs
- SimpleType.cs
- ObservableCollection.cs
- MimeTypeAttribute.cs
- CheckBox.cs
- TranslateTransform.cs
- WebPageTraceListener.cs
- OperationContextScope.cs
- DataGridAutoGeneratingColumnEventArgs.cs
- HeaderedItemsControl.cs
- HtmlTable.cs
- HttpAsyncResult.cs
- PackageRelationshipCollection.cs
- GAC.cs
- SqlVersion.cs
- FontInfo.cs
- XsltException.cs
- CommandID.cs
- InvariantComparer.cs