Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / EntityModel / SchemaObjectModel / SchemaElementLookUpTableEnumerator.cs / 1305376 / SchemaElementLookUpTableEnumerator.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using System; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; using System.Diagnostics; namespace System.Data.EntityModel.SchemaObjectModel { ////// Summary description for SchemaElementLookUpTableEnumerator. /// internal sealed class SchemaElementLookUpTableEnumerator: IEnumerator where T : S where S : SchemaElement { #region Instance Fields private Dictionary _data = null; private List .Enumerator _enumerator; #endregion #region Public Methods /// /// /// /// /// public SchemaElementLookUpTableEnumerator(Dictionarydata,List keysInOrder) { Debug.Assert(data != null, "data parameter is null"); Debug.Assert(keysInOrder != null, "keysInOrder parameter is null"); _data = data; _enumerator = keysInOrder.GetEnumerator(); } #endregion #region IEnumerator Members /// /// /// public void Reset() { // it is implemented explicitly ((IEnumerator)_enumerator).Reset(); } ////// /// public T Current { get { string key = _enumerator.Current; return _data[key] as T; } } object System.Collections.IEnumerator.Current { get { string key = _enumerator.Current; return _data[key] as T; } } ////// /// ///public bool MoveNext() { while ( _enumerator.MoveNext() ) { if ( Current != null ) return true; } return false; } #endregion #region IDisposable Members /// /// /// public void Dispose() { } #endregion } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using System; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; using System.Diagnostics; namespace System.Data.EntityModel.SchemaObjectModel { ////// Summary description for SchemaElementLookUpTableEnumerator. /// internal sealed class SchemaElementLookUpTableEnumerator: IEnumerator where T : S where S : SchemaElement { #region Instance Fields private Dictionary _data = null; private List .Enumerator _enumerator; #endregion #region Public Methods /// /// /// /// /// public SchemaElementLookUpTableEnumerator(Dictionarydata,List keysInOrder) { Debug.Assert(data != null, "data parameter is null"); Debug.Assert(keysInOrder != null, "keysInOrder parameter is null"); _data = data; _enumerator = keysInOrder.GetEnumerator(); } #endregion #region IEnumerator Members /// /// /// public void Reset() { // it is implemented explicitly ((IEnumerator)_enumerator).Reset(); } ////// /// public T Current { get { string key = _enumerator.Current; return _data[key] as T; } } object System.Collections.IEnumerator.Current { get { string key = _enumerator.Current; return _data[key] as T; } } ////// /// ///public bool MoveNext() { while ( _enumerator.MoveNext() ) { if ( Current != null ) return true; } return false; } #endregion #region IDisposable Members /// /// /// public void Dispose() { } #endregion } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Parser.cs
- AutomationElementIdentifiers.cs
- BrowserInteropHelper.cs
- PingOptions.cs
- CreateUserErrorEventArgs.cs
- Interlocked.cs
- LockRecoveryTask.cs
- DrawingAttributes.cs
- WebGetAttribute.cs
- ValueProviderWrapper.cs
- UniqueSet.cs
- CustomTypeDescriptor.cs
- ResourceBinder.cs
- AdRotatorDesigner.cs
- PageBuildProvider.cs
- SqlTypeSystemProvider.cs
- PlainXmlWriter.cs
- ComponentResourceKeyConverter.cs
- Stack.cs
- TypeSystemProvider.cs
- FileDialog.cs
- SoapReflectionImporter.cs
- ResourcesBuildProvider.cs
- Operand.cs
- BindToObject.cs
- HighContrastHelper.cs
- DateTimeFormatInfo.cs
- AppDomainProtocolHandler.cs
- BrowserCapabilitiesFactory.cs
- NavigationFailedEventArgs.cs
- TabItem.cs
- VirtualDirectoryMapping.cs
- PeerNearMe.cs
- ControllableStoryboardAction.cs
- securestring.cs
- EventDescriptorCollection.cs
- WaitHandleCannotBeOpenedException.cs
- FilterQueryOptionExpression.cs
- InternalCache.cs
- FrameSecurityDescriptor.cs
- AncestorChangedEventArgs.cs
- sapiproxy.cs
- Pair.cs
- ImpersonationContext.cs
- DiffuseMaterial.cs
- XmlParserContext.cs
- XmlUtil.cs
- DiscoveryEndpointElement.cs
- List.cs
- WebConvert.cs
- CopyAttributesAction.cs
- Viewport3DAutomationPeer.cs
- UserControlCodeDomTreeGenerator.cs
- SerializationStore.cs
- XmlCountingReader.cs
- PartitionerQueryOperator.cs
- XmlSchemaSet.cs
- SoapCommonClasses.cs
- ImageMapEventArgs.cs
- DbConnectionClosed.cs
- XmlNamespaceMappingCollection.cs
- DataGridViewLayoutData.cs
- ProgressBar.cs
- LifetimeMonitor.cs
- TextContainer.cs
- HttpListenerContext.cs
- NonBatchDirectoryCompiler.cs
- ValidateNames.cs
- InteropAutomationProvider.cs
- DependencyObjectPropertyDescriptor.cs
- CursorConverter.cs
- WebPartCancelEventArgs.cs
- SqlBooleanMismatchVisitor.cs
- WindowsScrollBarBits.cs
- CharEnumerator.cs
- Storyboard.cs
- JapaneseLunisolarCalendar.cs
- RecordManager.cs
- ExpressionPrefixAttribute.cs
- ListSourceHelper.cs
- WmlImageAdapter.cs
- EntitySetRetriever.cs
- Line.cs
- StringReader.cs
- ViewLoader.cs
- UriTemplateMatchException.cs
- SafeNativeMemoryHandle.cs
- _DigestClient.cs
- IndexerNameAttribute.cs
- commandenforcer.cs
- ListViewItem.cs
- GraphicsState.cs
- LongTypeConverter.cs
- TypeBuilder.cs
- ZipIOBlockManager.cs
- AssertFilter.cs
- XmlNavigatorStack.cs
- ImmComposition.cs
- MetafileHeaderEmf.cs
- DataObjectAttribute.cs