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
- XmlCollation.cs
- TemplateBindingExpression.cs
- DispatchChannelSink.cs
- HtmlPhoneCallAdapter.cs
- PersonalizationDictionary.cs
- TypeLoadException.cs
- RegionInfo.cs
- RegexBoyerMoore.cs
- CursorInteropHelper.cs
- DelegatingHeader.cs
- LockCookie.cs
- MissingFieldException.cs
- FigureParaClient.cs
- AppDomainShutdownMonitor.cs
- XmlSchemaExporter.cs
- ArgumentOutOfRangeException.cs
- ContentDesigner.cs
- WorkflowApplicationUnhandledExceptionEventArgs.cs
- HttpRequestWrapper.cs
- SerializationHelper.cs
- ResourceContainerWrapper.cs
- EntityAdapter.cs
- initElementDictionary.cs
- FlowDocumentScrollViewer.cs
- StylusPlugInCollection.cs
- TemplateBamlTreeBuilder.cs
- AlignmentXValidation.cs
- AjaxFrameworkAssemblyAttribute.cs
- XPathNodeHelper.cs
- BufferModeSettings.cs
- RegexFCD.cs
- bidPrivateBase.cs
- MediaEntryAttribute.cs
- ScaleTransform.cs
- _TimerThread.cs
- TableCellAutomationPeer.cs
- SplineQuaternionKeyFrame.cs
- GPPOINT.cs
- WebPartMinimizeVerb.cs
- FreezableCollection.cs
- WorkflowExecutor.cs
- CodeTypeReferenceExpression.cs
- Matrix.cs
- TransactionBehavior.cs
- TypedReference.cs
- PermissionSetEnumerator.cs
- _DigestClient.cs
- ImageDrawing.cs
- EntityDesignerUtils.cs
- XmlNamespaceMapping.cs
- DataServiceRequestArgs.cs
- WindowsScroll.cs
- ValidationPropertyAttribute.cs
- DynamicUpdateCommand.cs
- AnnotationHelper.cs
- XPathSelectionIterator.cs
- XmlCodeExporter.cs
- ZipFileInfo.cs
- DataSourceCacheDurationConverter.cs
- AnonymousIdentificationSection.cs
- RemotingConfigParser.cs
- ListViewItem.cs
- GridViewPageEventArgs.cs
- ReceiveSecurityHeaderEntry.cs
- PropertyDescriptorGridEntry.cs
- cookie.cs
- ProgressBar.cs
- ProfilePropertySettings.cs
- StatusInfoItem.cs
- SystemUnicastIPAddressInformation.cs
- WindowsListViewGroupHelper.cs
- CallbackDebugElement.cs
- HotSpotCollection.cs
- HttpRequestBase.cs
- ActivityCodeDomSerializationManager.cs
- ListenerAdapterBase.cs
- ValidationSummary.cs
- ObjectSet.cs
- IpcManager.cs
- CreateUserWizardStep.cs
- WebRequestModulesSection.cs
- MessageDescription.cs
- TailPinnedEventArgs.cs
- TypeReference.cs
- CompoundFileIOPermission.cs
- WebPartTracker.cs
- TimerExtension.cs
- SafeNativeHandle.cs
- Pair.cs
- KeyedHashAlgorithm.cs
- EditorPartChrome.cs
- BuildProvidersCompiler.cs
- sqlpipe.cs
- WpfKnownMemberInvoker.cs
- GridEntryCollection.cs
- CultureInfo.cs
- QueryRewriter.cs
- ProfilePropertySettingsCollection.cs
- TrackingStringDictionary.cs
- MembershipPasswordException.cs