Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / MS / Internal / Controls / EmptyEnumerator.cs / 1305600 / EmptyEnumerator.cs
//---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // // Description: Empty enumerator // // History: // 02/26/2004 : JeffBog stole from ItemsView (and stole comments from UIAutomation) // //--------------------------------------------------------------------------- using System; using System.Collections; namespace MS.Internal.Controls { ////// Returns an Enumerator that enumerates over nothing. /// internal class EmptyEnumerator: IEnumerator { // singleton class, private ctor private EmptyEnumerator() { } ////// Read-Only instance of an Empty Enumerator. /// public static IEnumerator Instance { get { if (_instance == null) { _instance = new EmptyEnumerator(); } return _instance; } } ////// Does nothing. /// public void Reset() { } ////// Returns false. /// ///false public bool MoveNext() { return false; } #pragma warning disable 1634, 1691 // about to use PreSharp message numbers - unknown to C# ////// Returns null. /// public object Current { get { #pragma warning disable 6503 // "Property get methods should not throw exceptions." throw new InvalidOperationException(); #pragma warning restore 6503 } } #pragma warning restore 1634, 1691 private static IEnumerator _instance; } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // // Description: Empty enumerator // // History: // 02/26/2004 : JeffBog stole from ItemsView (and stole comments from UIAutomation) // //--------------------------------------------------------------------------- using System; using System.Collections; namespace MS.Internal.Controls { ////// Returns an Enumerator that enumerates over nothing. /// internal class EmptyEnumerator: IEnumerator { // singleton class, private ctor private EmptyEnumerator() { } ////// Read-Only instance of an Empty Enumerator. /// public static IEnumerator Instance { get { if (_instance == null) { _instance = new EmptyEnumerator(); } return _instance; } } ////// Does nothing. /// public void Reset() { } ////// Returns false. /// ///false public bool MoveNext() { return false; } #pragma warning disable 1634, 1691 // about to use PreSharp message numbers - unknown to C# ////// Returns null. /// public object Current { get { #pragma warning disable 6503 // "Property get methods should not throw exceptions." throw new InvalidOperationException(); #pragma warning restore 6503 } } #pragma warning restore 1634, 1691 private static IEnumerator _instance; } } // 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
- CommandBinding.cs
- SystemGatewayIPAddressInformation.cs
- Matrix3DConverter.cs
- ToolStripContentPanelRenderEventArgs.cs
- CharAnimationUsingKeyFrames.cs
- XmlSchemaParticle.cs
- TypeBrowserDialog.cs
- TrackBar.cs
- FontWeights.cs
- LockRenewalTask.cs
- GeneralTransform.cs
- WindowsSecurityTokenAuthenticator.cs
- DatagridviewDisplayedBandsData.cs
- Positioning.cs
- LinqDataSourceHelper.cs
- WriteStateInfoBase.cs
- GlyphShapingProperties.cs
- TdsParserSessionPool.cs
- GacUtil.cs
- XmlSchemaInfo.cs
- DispatchChannelSink.cs
- PreloadHost.cs
- OdbcFactory.cs
- ProcessModelInfo.cs
- SkinBuilder.cs
- OleDbSchemaGuid.cs
- AddInIpcChannel.cs
- IntegerFacetDescriptionElement.cs
- UpdateProgress.cs
- GeneralTransform3D.cs
- HttpCacheParams.cs
- _ServiceNameStore.cs
- XmlCustomFormatter.cs
- ValueProviderWrapper.cs
- MimeMultiPart.cs
- InvalidOperationException.cs
- BitmapEffectCollection.cs
- COM2PropertyDescriptor.cs
- FieldDescriptor.cs
- Adorner.cs
- FillBehavior.cs
- EffectiveValueEntry.cs
- SimpleLine.cs
- LogAppendAsyncResult.cs
- EmbeddedMailObjectCollectionEditor.cs
- WebBrowsableAttribute.cs
- DecoratedNameAttribute.cs
- ExpressionEditorAttribute.cs
- EntityDataSourceWizardForm.cs
- OdbcCommand.cs
- ArraySegment.cs
- InsufficientExecutionStackException.cs
- VisualSerializer.cs
- XslCompiledTransform.cs
- PasswordRecovery.cs
- TreeNodeEventArgs.cs
- PasswordValidationException.cs
- PageOutputColor.cs
- EdmItemCollection.OcAssemblyCache.cs
- SudsParser.cs
- BaseProcessor.cs
- DataGridViewCellStyleBuilderDialog.cs
- FontClient.cs
- DefaultMemberAttribute.cs
- MetadataArtifactLoaderComposite.cs
- TreeViewAutomationPeer.cs
- TypeUnloadedException.cs
- hresults.cs
- TableLayoutPanelCellPosition.cs
- TemplatedWizardStep.cs
- ListDictionaryInternal.cs
- Base64Decoder.cs
- UInt32Storage.cs
- PackageStore.cs
- ColorContext.cs
- CanExecuteRoutedEventArgs.cs
- DrawingBrush.cs
- NameObjectCollectionBase.cs
- WindowsTokenRoleProvider.cs
- ApplicationBuildProvider.cs
- ContentPropertyAttribute.cs
- EntityModelSchemaGenerator.cs
- AsyncStreamReader.cs
- StyleSelector.cs
- TextRenderer.cs
- CellTreeSimplifier.cs
- RolePrincipal.cs
- KeyboardEventArgs.cs
- MappingItemCollection.cs
- WebPartCatalogCloseVerb.cs
- MimeTypeMapper.cs
- Select.cs
- IssuanceLicense.cs
- List.cs
- GraphicsContainer.cs
- JapaneseLunisolarCalendar.cs
- Emitter.cs
- querybuilder.cs
- ScrollBarRenderer.cs
- ObjectDataSourceDisposingEventArgs.cs