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
- ContentElementCollection.cs
- HtmlInputRadioButton.cs
- TreeNodeClickEventArgs.cs
- LinqToSqlWrapper.cs
- RightsManagementLicense.cs
- ServiceModelConfiguration.cs
- DocumentSequenceHighlightLayer.cs
- DataGridTablesFactory.cs
- Transaction.cs
- WasNotInstalledException.cs
- Peer.cs
- Shape.cs
- ConnectionStringsExpressionEditor.cs
- _NegotiateClient.cs
- FileClassifier.cs
- CommonServiceBehaviorElement.cs
- DataGridViewAutoSizeModeEventArgs.cs
- ConnectionStringSettings.cs
- VariableQuery.cs
- MulticastIPAddressInformationCollection.cs
- XPathQueryGenerator.cs
- embossbitmapeffect.cs
- EventProviderWriter.cs
- SurrogateChar.cs
- NavigationProgressEventArgs.cs
- ClientUrlResolverWrapper.cs
- PropertyFilterAttribute.cs
- OleDbParameter.cs
- SspiNegotiationTokenAuthenticatorState.cs
- TextEditorParagraphs.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- ScriptResourceAttribute.cs
- StartFileNameEditor.cs
- String.cs
- RouteParameter.cs
- SchemaImporterExtensionElementCollection.cs
- SelectionRange.cs
- RoleGroupCollection.cs
- Rectangle.cs
- ContainerUtilities.cs
- TransformGroup.cs
- WindowsServiceCredential.cs
- XsltLoader.cs
- ProfessionalColorTable.cs
- EmbeddedMailObject.cs
- RtfFormatStack.cs
- ControlEvent.cs
- ColorTypeConverter.cs
- MiniLockedBorderGlyph.cs
- HwndSubclass.cs
- LinqDataSourceHelper.cs
- CodeMemberEvent.cs
- CapiSafeHandles.cs
- ServiceModelSecurityTokenRequirement.cs
- DefaultSettingsSection.cs
- ObjectNotFoundException.cs
- CryptoApi.cs
- ConnectionStringsSection.cs
- TypeGeneratedEventArgs.cs
- Quaternion.cs
- QilXmlWriter.cs
- TypeCodeDomSerializer.cs
- MetadataProperty.cs
- ApplicationBuildProvider.cs
- SamlAttribute.cs
- DeclarativeCatalogPart.cs
- OutputCacheProfile.cs
- TaiwanLunisolarCalendar.cs
- CodeIdentifier.cs
- Visual.cs
- XmlDataFileEditor.cs
- CategoryGridEntry.cs
- SigningProgress.cs
- DbConnectionPoolGroupProviderInfo.cs
- HttpPostedFile.cs
- RemoteEndpointMessageProperty.cs
- SafeProcessHandle.cs
- CompiledIdentityConstraint.cs
- SystemDiagnosticsSection.cs
- WrappedReader.cs
- ZipArchive.cs
- GB18030Encoding.cs
- ProxyElement.cs
- PropertyChangedEventManager.cs
- ChtmlMobileTextWriter.cs
- HttpListenerException.cs
- NavigationProperty.cs
- ReadWriteSpinLock.cs
- DataSourceCacheDurationConverter.cs
- StorageMappingFragment.cs
- SafeHandles.cs
- XPathMessageFilterElementComparer.cs
- TextBoxLine.cs
- SerializationException.cs
- ClientFormsAuthenticationCredentials.cs
- ToolboxComponentsCreatedEventArgs.cs
- sapiproxy.cs
- DelayedRegex.cs
- DrawingCollection.cs
- Unit.cs