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
- ForeignKeyFactory.cs
- JobPageOrder.cs
- XmlDocumentType.cs
- ViewCellRelation.cs
- PrimitiveXmlSerializers.cs
- IdentityNotMappedException.cs
- XmlLinkedNode.cs
- WebEvents.cs
- Message.cs
- GeneralTransformGroup.cs
- EditingCommands.cs
- HMACSHA512.cs
- DoubleCollectionValueSerializer.cs
- SystemIPAddressInformation.cs
- MobileUITypeEditor.cs
- MultiPropertyDescriptorGridEntry.cs
- FormsAuthenticationCredentials.cs
- EventProviderWriter.cs
- UdpMessageProperty.cs
- ExceptionHelpers.cs
- NetCodeGroup.cs
- HttpModulesSection.cs
- PlanCompilerUtil.cs
- CatalogPart.cs
- RewritingPass.cs
- FrugalList.cs
- AdornedElementPlaceholder.cs
- GridViewColumnCollection.cs
- ClientSettingsStore.cs
- WebDisplayNameAttribute.cs
- TransactedBatchingBehavior.cs
- QilNode.cs
- VisualStyleInformation.cs
- Point4DConverter.cs
- HttpApplication.cs
- ISAPIRuntime.cs
- ValidationPropertyAttribute.cs
- Animatable.cs
- WebRequestModuleElementCollection.cs
- ListSortDescriptionCollection.cs
- GroupLabel.cs
- Floater.cs
- _BasicClient.cs
- ApplicationInfo.cs
- Point3D.cs
- TextEditorCopyPaste.cs
- ApplicationInfo.cs
- DataBoundControlHelper.cs
- SafeNativeMethodsMilCoreApi.cs
- HttpContextServiceHost.cs
- XmlILStorageConverter.cs
- XmlToDatasetMap.cs
- AdornedElementPlaceholder.cs
- TraceInternal.cs
- Filter.cs
- HtmlInputText.cs
- ToolboxControl.cs
- SizeAnimationBase.cs
- TracedNativeMethods.cs
- __Error.cs
- FontSource.cs
- Keywords.cs
- TreeViewEvent.cs
- SqlProvider.cs
- DataServiceExpressionVisitor.cs
- DynamicActivityXamlReader.cs
- OleDbInfoMessageEvent.cs
- COAUTHIDENTITY.cs
- SymbolDocumentGenerator.cs
- CurrentTimeZone.cs
- EventDriven.cs
- SwitchExpression.cs
- GestureRecognizer.cs
- XmlSerializationReader.cs
- ReflectionHelper.cs
- DurableRuntimeValidator.cs
- TextEncodedRawTextWriter.cs
- FilteredAttributeCollection.cs
- NullableDoubleSumAggregationOperator.cs
- DataTableClearEvent.cs
- ContextMarshalException.cs
- ActiveXHost.cs
- TextBox.cs
- HtmlInputRadioButton.cs
- VersionPair.cs
- HashAlgorithm.cs
- ProtocolsConfigurationEntry.cs
- XmlSerializerOperationFormatter.cs
- ExpandCollapsePatternIdentifiers.cs
- PrimitiveRenderer.cs
- RenameRuleObjectDialog.Designer.cs
- CompilerGlobalScopeAttribute.cs
- SurrogateEncoder.cs
- DrawingContextDrawingContextWalker.cs
- Simplifier.cs
- RelatedEnd.cs
- RSAPKCS1SignatureDeformatter.cs
- DataGridViewCellCollection.cs
- XmlArrayAttribute.cs
- BaseParser.cs