Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / Util / SingleObjectCollection.cs / 1305376 / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Utils.cs
- ClientSponsor.cs
- HttpTransportBindingElement.cs
- CryptoConfig.cs
- Msec.cs
- QuerySettings.cs
- RadioButtonPopupAdapter.cs
- NativeCompoundFileAPIs.cs
- EntityDataSourceDesigner.cs
- RoleService.cs
- IPipelineRuntime.cs
- DataGridViewRowsAddedEventArgs.cs
- DbBuffer.cs
- RbTree.cs
- ProxyHelper.cs
- TextTreePropertyUndoUnit.cs
- SafeNativeMethods.cs
- GraphicsContainer.cs
- BitmapEffectState.cs
- PreProcessInputEventArgs.cs
- FixedSOMPage.cs
- CookielessHelper.cs
- TransformPatternIdentifiers.cs
- ReflectionServiceProvider.cs
- RemoteHelper.cs
- TransformConverter.cs
- InstanceKeyNotReadyException.cs
- AffineTransform3D.cs
- StringResourceManager.cs
- TrackBarDesigner.cs
- AdCreatedEventArgs.cs
- OleServicesContext.cs
- DecodeHelper.cs
- XmlAnyElementAttributes.cs
- ZipIOCentralDirectoryFileHeader.cs
- SchemaObjectWriter.cs
- FormClosingEvent.cs
- CompositeScriptReference.cs
- DataListItem.cs
- EntityViewGenerationConstants.cs
- RelatedPropertyManager.cs
- XmlWrappingReader.cs
- AdapterDictionary.cs
- TreeNodeConverter.cs
- DebugControllerThread.cs
- MarkupCompilePass2.cs
- ServerValidateEventArgs.cs
- ValueSerializer.cs
- AutomationTextAttribute.cs
- EntityViewGenerator.cs
- HttpFileCollectionWrapper.cs
- MouseWheelEventArgs.cs
- EntryWrittenEventArgs.cs
- NotImplementedException.cs
- LinkLabelLinkClickedEvent.cs
- TypedReference.cs
- safesecurityhelperavalon.cs
- DocComment.cs
- CorrelationRequestContext.cs
- ConsumerConnectionPointCollection.cs
- RuleInfoComparer.cs
- Message.cs
- DiagnosticSection.cs
- PermissionSetTriple.cs
- BuilderInfo.cs
- controlskin.cs
- BaseParser.cs
- ObjectReaderCompiler.cs
- XmlIgnoreAttribute.cs
- DocumentPage.cs
- TextServicesCompartment.cs
- SystemSounds.cs
- CodePageUtils.cs
- SelectionList.cs
- FacetValueContainer.cs
- WindowsRichEditRange.cs
- OleDbError.cs
- ButtonStandardAdapter.cs
- PackWebResponse.cs
- DictionaryEntry.cs
- Point3DCollection.cs
- Timer.cs
- ByteAnimationUsingKeyFrames.cs
- ControlCachePolicy.cs
- TaskFileService.cs
- MimeTypeMapper.cs
- FormViewInsertEventArgs.cs
- XmlCharCheckingWriter.cs
- Rotation3DAnimation.cs
- sqlcontext.cs
- ImageMetadata.cs
- DataGridViewTextBoxEditingControl.cs
- ListControlConvertEventArgs.cs
- AnnotationAdorner.cs
- ServiceDescription.cs
- CoTaskMemHandle.cs
- InstanceDataCollectionCollection.cs
- WizardPanel.cs
- SerializationFieldInfo.cs
- BordersPage.cs