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
- MediaScriptCommandRoutedEventArgs.cs
- SmiEventSink_DeferedProcessing.cs
- LayoutTable.cs
- DataGridViewCellValidatingEventArgs.cs
- MailWriter.cs
- BufferedWebEventProvider.cs
- StrokeNodeData.cs
- MetadataException.cs
- PageAsyncTask.cs
- ListView.cs
- CustomTypeDescriptor.cs
- ComponentResourceManager.cs
- QueryStringParameter.cs
- UpdateException.cs
- Axis.cs
- SqlRecordBuffer.cs
- DetailsViewDeleteEventArgs.cs
- OleDbException.cs
- JsonDeserializer.cs
- ImageCodecInfoPrivate.cs
- DetailsViewInsertedEventArgs.cs
- WindowsSpinner.cs
- Rotation3DAnimation.cs
- IpcManager.cs
- UnsafeNativeMethods.cs
- Dictionary.cs
- GroupLabel.cs
- ToolStripItem.cs
- StylusPointPropertyId.cs
- SecurityPolicySection.cs
- SymmetricAlgorithm.cs
- SelectionManager.cs
- DayRenderEvent.cs
- XPathAncestorIterator.cs
- FunctionGenerator.cs
- ButtonBaseAdapter.cs
- __TransparentProxy.cs
- FontStretches.cs
- SelectionEditingBehavior.cs
- RenderData.cs
- Int32Rect.cs
- TextPointer.cs
- MenuAutoFormat.cs
- Ref.cs
- DeclarativeConditionsCollection.cs
- UInt16Storage.cs
- HttpCapabilitiesBase.cs
- MergablePropertyAttribute.cs
- SourceSwitch.cs
- UserPreferenceChangedEventArgs.cs
- ThicknessAnimationUsingKeyFrames.cs
- WizardForm.cs
- Geometry.cs
- CompositeDispatchFormatter.cs
- TypeConverterAttribute.cs
- SecurityCriticalDataForSet.cs
- CodeDirectoryCompiler.cs
- ListControl.cs
- MsmqIntegrationSecurityElement.cs
- ListSourceHelper.cs
- MergeExecutor.cs
- DeferrableContent.cs
- XmlSchemaProviderAttribute.cs
- PropertyRef.cs
- SmtpSection.cs
- OpenTypeLayout.cs
- ProxyWebPartManagerDesigner.cs
- RepeatBehavior.cs
- ContentValidator.cs
- IImplicitResourceProvider.cs
- MoveSizeWinEventHandler.cs
- ListViewItemEventArgs.cs
- JsonByteArrayDataContract.cs
- DataServiceConfiguration.cs
- TextEditorTyping.cs
- DocumentReference.cs
- SqlBinder.cs
- JournalEntry.cs
- HwndProxyElementProvider.cs
- WebPartDisplayMode.cs
- MonikerUtility.cs
- AuditLevel.cs
- Overlapped.cs
- Mapping.cs
- ButtonBaseAutomationPeer.cs
- Span.cs
- CapabilitiesRule.cs
- BulletedList.cs
- InitializationEventAttribute.cs
- XmlBufferReader.cs
- BridgeDataRecord.cs
- MsmqMessageProperty.cs
- wmiprovider.cs
- DefaultTextStore.cs
- MetadataArtifactLoaderCompositeResource.cs
- ViewValidator.cs
- DivideByZeroException.cs
- GeneralTransformGroup.cs
- TransactionChannelListener.cs
- StringValidator.cs