Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / 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() { } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ProxyWebPartConnectionCollection.cs
- HttpFileCollection.cs
- Utils.cs
- TCPListener.cs
- VerificationException.cs
- ToolStripStatusLabel.cs
- WizardPanelChangingEventArgs.cs
- Base64Encoder.cs
- CodeMemberEvent.cs
- CursorConverter.cs
- AliasedSlot.cs
- EmbeddedObject.cs
- TextBoxBase.cs
- EventNotify.cs
- SqlDataRecord.cs
- EdmSchemaAttribute.cs
- MenuItem.cs
- HitTestFilterBehavior.cs
- NestPullup.cs
- RedBlackList.cs
- SqlXml.cs
- HierarchicalDataBoundControlAdapter.cs
- LogEntry.cs
- WebPartManager.cs
- SafeTimerHandle.cs
- __FastResourceComparer.cs
- MemberMemberBinding.cs
- TrackingStringDictionary.cs
- ByteRangeDownloader.cs
- EndPoint.cs
- WpfXamlMember.cs
- StatusStrip.cs
- SelfIssuedAuthRSACryptoProvider.cs
- ZipIOLocalFileDataDescriptor.cs
- ReferenceAssemblyAttribute.cs
- Operator.cs
- ToolBarPanel.cs
- IPHostEntry.cs
- ResourcePermissionBase.cs
- KeyValueSerializer.cs
- GlyphingCache.cs
- ProfileSection.cs
- ToolStripTemplateNode.cs
- FileLogRecordStream.cs
- ColorContext.cs
- DocumentViewerBaseAutomationPeer.cs
- ListBoxItemWrapperAutomationPeer.cs
- DataSourceCache.cs
- CompositeDataBoundControl.cs
- documentsequencetextview.cs
- MDIClient.cs
- FilterableAttribute.cs
- AnonymousIdentificationModule.cs
- RepeatButtonAutomationPeer.cs
- FixedTextBuilder.cs
- ClassGenerator.cs
- DoubleStorage.cs
- URLMembershipCondition.cs
- TypedTableGenerator.cs
- MarshalByRefObject.cs
- CheckedPointers.cs
- StackOverflowException.cs
- WindowsStartMenu.cs
- StylusPointDescription.cs
- entityreference_tresulttype.cs
- GacUtil.cs
- InvalidWMPVersionException.cs
- RequestCachePolicyConverter.cs
- EntityDescriptor.cs
- DataTemplateSelector.cs
- WebRequestModulesSection.cs
- ParameterReplacerVisitor.cs
- PerfCounterSection.cs
- ProcessInfo.cs
- LifetimeServices.cs
- EllipticalNodeOperations.cs
- WasAdminWrapper.cs
- PageParserFilter.cs
- ColumnWidthChangedEvent.cs
- SessionStateModule.cs
- BaseTreeIterator.cs
- RequestBringIntoViewEventArgs.cs
- DataGridCaption.cs
- BaseServiceProvider.cs
- FixedSOMPageElement.cs
- ScriptResourceInfo.cs
- CngProvider.cs
- RightsManagementPermission.cs
- TdsParserStateObject.cs
- WebScriptClientGenerator.cs
- TdsEnums.cs
- Timer.cs
- PathSegment.cs
- NavigationCommands.cs
- ACL.cs
- OdbcConnection.cs
- designeractionlistschangedeventargs.cs
- XmlSerializationWriter.cs
- WindowsIdentity.cs
- ModuleBuilder.cs