Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- HelpEvent.cs
- XXXInfos.cs
- IPipelineRuntime.cs
- RequestBringIntoViewEventArgs.cs
- LinkClickEvent.cs
- SchemaMapping.cs
- HelpProvider.cs
- MenuEventArgs.cs
- SQLInt16Storage.cs
- DynamicILGenerator.cs
- Encoding.cs
- AuthenticatedStream.cs
- IsolatedStorageException.cs
- WebBrowserNavigatingEventHandler.cs
- PeerResolver.cs
- figurelengthconverter.cs
- UnknownWrapper.cs
- DateTimeOffsetStorage.cs
- MsmqInputSessionChannelListener.cs
- EnumerableValidator.cs
- InputQueue.cs
- RegistrySecurity.cs
- TemplateControlBuildProvider.cs
- ColorEditor.cs
- RsaSecurityTokenAuthenticator.cs
- SizeLimitedCache.cs
- GCHandleCookieTable.cs
- BitmapCodecInfo.cs
- MetabaseServerConfig.cs
- PermissionToken.cs
- LookupNode.cs
- Ops.cs
- Pen.cs
- XmlSchemaElement.cs
- shaper.cs
- WebPartMinimizeVerb.cs
- SessionParameter.cs
- TemplatedMailWebEventProvider.cs
- XamlWriter.cs
- AdjustableArrowCap.cs
- DoubleUtil.cs
- OptionalMessageQuery.cs
- BinaryObjectInfo.cs
- LinkedResource.cs
- SecurityElement.cs
- EnumCodeDomSerializer.cs
- Color.cs
- ResourceDictionary.cs
- EasingKeyFrames.cs
- LogReservationCollection.cs
- ExtendedPropertyCollection.cs
- OleDbRowUpdatedEvent.cs
- DoubleIndependentAnimationStorage.cs
- XamlReader.cs
- MessageBuilder.cs
- DocumentViewerBase.cs
- ListCommandEventArgs.cs
- SelectorItemAutomationPeer.cs
- EntityDataSourceDesigner.cs
- NullableBoolConverter.cs
- TextEditorTables.cs
- PrintController.cs
- HtmlTernaryTree.cs
- XmlException.cs
- SingleSelectRootGridEntry.cs
- DelegateSerializationHolder.cs
- CommandLibraryHelper.cs
- _WinHttpWebProxyDataBuilder.cs
- JoinElimination.cs
- NegotiationTokenAuthenticatorState.cs
- TransformerTypeCollection.cs
- DefaultValueAttribute.cs
- GPPOINT.cs
- Icon.cs
- LinkedResourceCollection.cs
- CollectionDataContract.cs
- SpellerInterop.cs
- TraceAsyncResult.cs
- ContractMapping.cs
- SAPIEngineTypes.cs
- ZipIORawDataFileBlock.cs
- ParamArrayAttribute.cs
- AccessibilityApplicationManager.cs
- ReflectionUtil.cs
- WinEventTracker.cs
- MenuEventArgs.cs
- EpmSyndicationContentDeSerializer.cs
- Compress.cs
- LinqDataSourceStatusEventArgs.cs
- XmlSchemaSimpleType.cs
- ScriptModule.cs
- DataGridViewCheckBoxCell.cs
- DocumentPaginator.cs
- FileEnumerator.cs
- ClientOptions.cs
- DesignBindingPicker.cs
- CLSCompliantAttribute.cs
- DataView.cs
- QueryOptionExpression.cs
- NotifyCollectionChangedEventArgs.cs