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
- XmlException.cs
- util.cs
- ListBoxItemAutomationPeer.cs
- MutexSecurity.cs
- BindingExpressionUncommonField.cs
- MultipleViewPatternIdentifiers.cs
- SequentialUshortCollection.cs
- EventHandlerList.cs
- ParameterCollectionEditorForm.cs
- PathTooLongException.cs
- ModifierKeysConverter.cs
- PrintController.cs
- StreamWithDictionary.cs
- AttachedPropertiesService.cs
- AuthenticationConfig.cs
- TraceContextEventArgs.cs
- OdbcStatementHandle.cs
- BitmapEffectDrawingContextState.cs
- Rect3D.cs
- DocumentPageViewAutomationPeer.cs
- DrawingContext.cs
- ProxyWebPartConnectionCollection.cs
- TypeInitializationException.cs
- InputScopeManager.cs
- _LocalDataStoreMgr.cs
- RelationshipEndCollection.cs
- PresentationSource.cs
- typedescriptorpermissionattribute.cs
- Win32Native.cs
- ScrollChangedEventArgs.cs
- SafeNativeMethods.cs
- TextCharacters.cs
- DrawingContextDrawingContextWalker.cs
- BulletedListDesigner.cs
- SqlConnectionFactory.cs
- AuthenticationModuleElementCollection.cs
- TextBoxRenderer.cs
- FtpWebRequest.cs
- NameValuePair.cs
- MenuCommandService.cs
- ChtmlFormAdapter.cs
- DataGridViewSelectedCellsAccessibleObject.cs
- DocComment.cs
- ColumnResizeUndoUnit.cs
- InternalCache.cs
- MutexSecurity.cs
- SqlLiftWhereClauses.cs
- ConfigurationProviderException.cs
- ExpressionCopier.cs
- CustomActivityDesigner.cs
- UmAlQuraCalendar.cs
- GridViewSelectEventArgs.cs
- DnsPermission.cs
- PeerApplication.cs
- DesignObjectWrapper.cs
- BufferModesCollection.cs
- NameHandler.cs
- AsymmetricAlgorithm.cs
- RadioButtonPopupAdapter.cs
- Matrix3DValueSerializer.cs
- ObjectStateEntry.cs
- ByteAnimation.cs
- EventManager.cs
- Roles.cs
- XmlDocumentType.cs
- OpenTypeCommon.cs
- CheckBoxRenderer.cs
- ComponentFactoryHelpers.cs
- Graph.cs
- UnmanagedMarshal.cs
- TableLayoutColumnStyleCollection.cs
- RangeBase.cs
- assertwrapper.cs
- CodeTypeConstructor.cs
- GradientSpreadMethodValidation.cs
- UserControl.cs
- SchemaElement.cs
- WindowPatternIdentifiers.cs
- BamlBinaryReader.cs
- XmlSchemaProviderAttribute.cs
- Context.cs
- RuleSettingsCollection.cs
- BookmarkScopeInfo.cs
- Pts.cs
- GridItemPattern.cs
- ColumnMapVisitor.cs
- ContractComponent.cs
- ControlValuePropertyAttribute.cs
- RotationValidation.cs
- URL.cs
- FacetChecker.cs
- PkcsMisc.cs
- PerformanceCounterManager.cs
- Utility.cs
- SrgsRuleRef.cs
- ScriptingWebServicesSectionGroup.cs
- Literal.cs
- XmlExtensionFunction.cs
- FlowNode.cs
- RegisteredArrayDeclaration.cs