Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- HttpStaticObjectsCollectionWrapper.cs
- WebPartConnectionsEventArgs.cs
- XmlAttribute.cs
- WebPartUtil.cs
- InfoCardRSAPKCS1KeyExchangeFormatter.cs
- Attributes.cs
- RemotingConfigParser.cs
- MouseBinding.cs
- PaintValueEventArgs.cs
- UnsafeNativeMethods.cs
- DataGridViewLinkColumn.cs
- JsonServiceDocumentSerializer.cs
- SynchronizationContext.cs
- SqlClientMetaDataCollectionNames.cs
- VectorAnimation.cs
- ImageSource.cs
- SelectionGlyph.cs
- PartitionedStream.cs
- TypefaceCollection.cs
- DBSqlParserTableCollection.cs
- SqlSupersetValidator.cs
- COM2ExtendedUITypeEditor.cs
- XamlPointCollectionSerializer.cs
- ObfuscateAssemblyAttribute.cs
- SamlAuthorizationDecisionStatement.cs
- Timer.cs
- XDRSchema.cs
- TrackBar.cs
- EntityDataSourceContextCreatingEventArgs.cs
- PerformanceCounterPermission.cs
- FontUnitConverter.cs
- OpCodes.cs
- MenuItemBindingCollection.cs
- Condition.cs
- Ticks.cs
- ChannelDispatcherCollection.cs
- HwndStylusInputProvider.cs
- ValueSerializer.cs
- RequestBringIntoViewEventArgs.cs
- RepeatButtonAutomationPeer.cs
- Aggregates.cs
- TreeView.cs
- CrossContextChannel.cs
- UdpChannelListener.cs
- FrameworkObject.cs
- DataControlCommands.cs
- GroupByExpressionRewriter.cs
- ClientConfigPaths.cs
- FontFaceLayoutInfo.cs
- ClientConfigPaths.cs
- MachineKeyValidationConverter.cs
- Margins.cs
- AuthenticateEventArgs.cs
- DoubleLink.cs
- UniqueEventHelper.cs
- PolicyAssertionCollection.cs
- MethodSet.cs
- ActiveXHelper.cs
- AutoGeneratedFieldProperties.cs
- EncoderFallback.cs
- DrawingGroup.cs
- CodeDomDesignerLoader.cs
- SkipQueryOptionExpression.cs
- SoapSchemaImporter.cs
- MessageAction.cs
- QuaternionRotation3D.cs
- ForEachAction.cs
- PassportAuthenticationModule.cs
- CancellationHandlerDesigner.cs
- entityreference_tresulttype.cs
- StorageScalarPropertyMapping.cs
- DataKey.cs
- BoundField.cs
- HttpClientChannel.cs
- SqlTypesSchemaImporter.cs
- Journaling.cs
- BuildProvider.cs
- Error.cs
- IndexOutOfRangeException.cs
- AssemblyInfo.cs
- ForwardPositionQuery.cs
- CriticalFinalizerObject.cs
- DataRecordInfo.cs
- ActivityScheduledQuery.cs
- Graphics.cs
- VoiceSynthesis.cs
- AbandonedMutexException.cs
- SiteMapDataSource.cs
- Int64AnimationBase.cs
- CallbackDebugElement.cs
- InheritanceContextHelper.cs
- AlternateViewCollection.cs
- EdmItemCollection.cs
- AnimationClockResource.cs
- ControlBuilder.cs
- ObservableCollection.cs
- EntityCommandCompilationException.cs
- UniqueConstraint.cs
- ReflectEventDescriptor.cs
- LinqDataSourceStatusEventArgs.cs