Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / ndp / fx / src / xsp / System / Web / Util / SingleObjectCollection.cs / 1 / SingleObjectCollection.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* * SingleObjectCollection class * * Copyright (c) 1999 Microsoft Corporation */ namespace System.Web.Util { using System.Collections; /* * Fast implementation of a collection with a single object */ internal class SingleObjectCollection: ICollection { private class SingleObjectEnumerator: IEnumerator { private object _object; private bool done; public SingleObjectEnumerator(object o) { _object = o; } public object Current { get { return _object; } } public bool MoveNext() { if (!done) { done = true; return true; } return false; } public void Reset() { done = false; } } private object _object; public SingleObjectCollection(object o) { _object = o; } IEnumerator IEnumerable.GetEnumerator() { return new SingleObjectEnumerator(_object); } public int Count { get { return 1; } } bool ICollection.IsSynchronized { get { return true; } } object ICollection.SyncRoot { get { return this; } } public void CopyTo(Array array, int index) { array.SetValue(_object, index); } } } // 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
- QueueProcessor.cs
- PolygonHotSpot.cs
- DataIdProcessor.cs
- WeakEventManager.cs
- SoapSchemaMember.cs
- OutOfMemoryException.cs
- ColumnTypeConverter.cs
- OdbcCommandBuilder.cs
- CodeAttributeDeclaration.cs
- SequentialWorkflowRootDesigner.cs
- _NegotiateClient.cs
- InlineCollection.cs
- ConfigXmlText.cs
- PixelFormatConverter.cs
- TabItemAutomationPeer.cs
- Accessors.cs
- CompensationHandlingFilter.cs
- CalendarDay.cs
- SQLSingleStorage.cs
- ImportContext.cs
- TimeSpan.cs
- altserialization.cs
- ValidationSummary.cs
- TextRunTypographyProperties.cs
- String.cs
- DesignerDataConnection.cs
- XmlSerializerFactory.cs
- HttpResponse.cs
- PartDesigner.cs
- GridViewColumnHeaderAutomationPeer.cs
- Timeline.cs
- InfoCardRSAPKCS1KeyExchangeFormatter.cs
- StateManager.cs
- UnsignedPublishLicense.cs
- LocalizedNameDescriptionPair.cs
- BaseAutoFormat.cs
- MessageFilterTable.cs
- SpanIndex.cs
- Separator.cs
- TraceSection.cs
- HostProtectionPermission.cs
- RedirectionProxy.cs
- UnSafeCharBuffer.cs
- ResXResourceWriter.cs
- SqlReferenceCollection.cs
- EncoderBestFitFallback.cs
- LineBreak.cs
- SafeNativeMethodsMilCoreApi.cs
- DocumentGridPage.cs
- TreeViewTemplateSelector.cs
- Command.cs
- VectorCollectionConverter.cs
- WebHttpElement.cs
- Point3DConverter.cs
- Rights.cs
- FactoryMaker.cs
- HtmlWindow.cs
- SearchForVirtualItemEventArgs.cs
- mediapermission.cs
- DataGridViewSelectedCellCollection.cs
- FacetValues.cs
- WebPartMenuStyle.cs
- CryptoKeySecurity.cs
- DataRowComparer.cs
- TableChangeProcessor.cs
- DateTimeConverter.cs
- Package.cs
- BordersPage.cs
- ExpressionVisitor.cs
- LicenseException.cs
- FloatAverageAggregationOperator.cs
- MergablePropertyAttribute.cs
- TextAction.cs
- DataGridItemEventArgs.cs
- CompletedAsyncResult.cs
- PropertyRef.cs
- SafePointer.cs
- TabletCollection.cs
- WorkflowTerminatedException.cs
- DependencyPropertyHelper.cs
- VBIdentifierNameEditor.cs
- InternalBase.cs
- MarkedHighlightComponent.cs
- Misc.cs
- _SslSessionsCache.cs
- CipherData.cs
- SamlEvidence.cs
- _DigestClient.cs
- ASCIIEncoding.cs
- CharacterMetricsDictionary.cs
- ColorContextHelper.cs
- DnsPermission.cs
- ExecutionEngineException.cs
- RefreshEventArgs.cs
- Delegate.cs
- LogicalExpr.cs
- Rect3D.cs
- HttpModuleAction.cs
- FunctionOverloadResolver.cs
- KeyFrames.cs