Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / Framework / MS / Internal / Controls / EmptyEnumerator.cs / 1 / 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
- JoinCqlBlock.cs
- ProfilePropertySettings.cs
- Metafile.cs
- CodeTypeMemberCollection.cs
- FileClassifier.cs
- ClientConvert.cs
- ApplicationServicesHostFactory.cs
- UpDownBase.cs
- TextTreeObjectNode.cs
- XmlEntityReference.cs
- ThicknessConverter.cs
- ImportDesigner.xaml.cs
- EncryptedType.cs
- CompilationUtil.cs
- LogLogRecord.cs
- DesignerCategoryAttribute.cs
- TemplateControlCodeDomTreeGenerator.cs
- XpsDigitalSignature.cs
- AttachedPropertyMethodSelector.cs
- PlatformNotSupportedException.cs
- InvokeProviderWrapper.cs
- TypeBrowserDialog.cs
- COM2ICategorizePropertiesHandler.cs
- CheckBoxPopupAdapter.cs
- ConnectionInterfaceCollection.cs
- HtmlLiteralTextAdapter.cs
- DispatchWrapper.cs
- SelectionWordBreaker.cs
- PropertyFilterAttribute.cs
- XsdDataContractImporter.cs
- _Connection.cs
- SequentialOutput.cs
- DoubleAnimationUsingKeyFrames.cs
- Shape.cs
- WindowsScroll.cs
- NamespaceDecl.cs
- URLIdentityPermission.cs
- WindowsSlider.cs
- BuildResult.cs
- ResXDataNode.cs
- ContentElement.cs
- SqlClientMetaDataCollectionNames.cs
- StorageBasedPackageProperties.cs
- CompilerHelpers.cs
- XmlSubtreeReader.cs
- SpinLock.cs
- StorageInfo.cs
- HttpStreamMessage.cs
- ReliabilityContractAttribute.cs
- SqlDataSourceTableQuery.cs
- DbDataAdapter.cs
- JsonXmlDataContract.cs
- ResourceReferenceKeyNotFoundException.cs
- PeerCollaboration.cs
- DesignerUtility.cs
- RemoteWebConfigurationHostStream.cs
- MsmqElementBase.cs
- DataGridViewCellFormattingEventArgs.cs
- BasicExpressionVisitor.cs
- PageCatalogPartDesigner.cs
- TimeSpanStorage.cs
- OrderByBuilder.cs
- SelectManyQueryOperator.cs
- safelink.cs
- FlowchartSizeFeature.cs
- SafeHandle.cs
- IndentedWriter.cs
- ScriptBehaviorDescriptor.cs
- BitmapDecoder.cs
- HScrollBar.cs
- CommandPlan.cs
- ThreadAttributes.cs
- XmlLanguageConverter.cs
- OperandQuery.cs
- ArrayConverter.cs
- XamlWriter.cs
- SqlProvider.cs
- BeginEvent.cs
- DecimalAnimationBase.cs
- WindowsScrollBarBits.cs
- TimeZone.cs
- DateTimeConstantAttribute.cs
- _Events.cs
- LineGeometry.cs
- GridViewDeletedEventArgs.cs
- SoundPlayerAction.cs
- PropertyInfoSet.cs
- TemplateEditingService.cs
- MethodRental.cs
- WebPartDescription.cs
- _HeaderInfo.cs
- ServiceProviders.cs
- RefType.cs
- TableLayoutColumnStyleCollection.cs
- ApplicationContext.cs
- SmiEventSink_DeferedProcessing.cs
- TabItemWrapperAutomationPeer.cs
- SafeRightsManagementQueryHandle.cs
- ComContractElement.cs
- XamlWriter.cs