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
- ProcessStartInfo.cs
- ListBoxChrome.cs
- HttpFileCollection.cs
- DesignerEditorPartChrome.cs
- NavigationPropertySingletonExpression.cs
- OletxResourceManager.cs
- SHA256CryptoServiceProvider.cs
- Size3DValueSerializer.cs
- JournalEntryStack.cs
- CodeAttachEventStatement.cs
- SByte.cs
- InvalidPrinterException.cs
- BasicExpandProvider.cs
- StrokeDescriptor.cs
- DataGridPagingPage.cs
- DefaultEventAttribute.cs
- IndentedTextWriter.cs
- ITreeGenerator.cs
- PostBackTrigger.cs
- TcpTransportBindingElement.cs
- ThicknessConverter.cs
- PermissionSetTriple.cs
- Argument.cs
- GPPOINTF.cs
- Filter.cs
- ObjectCacheHost.cs
- OptionUsage.cs
- DataTableMappingCollection.cs
- FrameworkContentElement.cs
- SystemDropShadowChrome.cs
- FormViewPagerRow.cs
- SubtreeProcessor.cs
- SimpleRecyclingCache.cs
- LambdaCompiler.Binary.cs
- ExtensionSimplifierMarkupObject.cs
- ToolStripOverflow.cs
- XslAstAnalyzer.cs
- ScriptReferenceBase.cs
- UnsafeNativeMethods.cs
- ActivityAction.cs
- figurelength.cs
- XDRSchema.cs
- GridViewUpdatedEventArgs.cs
- Configuration.cs
- EntityDataSource.cs
- XmlValueConverter.cs
- HtmlControlAdapter.cs
- SocketInformation.cs
- MarkerProperties.cs
- GridViewAutoFormat.cs
- ValidationPropertyAttribute.cs
- SchemaContext.cs
- Bezier.cs
- ThumbButtonInfo.cs
- XpsResourceDictionary.cs
- BasePropertyDescriptor.cs
- MouseDevice.cs
- ToolStripItemRenderEventArgs.cs
- XmlCharCheckingReader.cs
- ArrayConverter.cs
- ConfigurationLocation.cs
- TextStore.cs
- BatchWriter.cs
- ExpandableObjectConverter.cs
- ConnectionStringsSection.cs
- PrintingPermissionAttribute.cs
- XmlTypeMapping.cs
- VisualStateChangedEventArgs.cs
- DbModificationClause.cs
- followingquery.cs
- DeleteHelper.cs
- MissingFieldException.cs
- LoadWorkflowByKeyAsyncResult.cs
- AssemblyNameProxy.cs
- ServerValidateEventArgs.cs
- ToolStripButton.cs
- MethodSignatureGenerator.cs
- DBPropSet.cs
- Typeface.cs
- AssociationType.cs
- UnsafeNativeMethods.cs
- ValidationSummary.cs
- ReadOnlyDictionary.cs
- XMLSchema.cs
- OleDbConnectionInternal.cs
- CodeIdentifiers.cs
- MetadataFile.cs
- DeploymentSectionCache.cs
- PrincipalPermission.cs
- COM2PropertyBuilderUITypeEditor.cs
- WebDisplayNameAttribute.cs
- ClientSponsor.cs
- Bezier.cs
- LayoutManager.cs
- ManagementEventWatcher.cs
- HttpStreamXmlDictionaryWriter.cs
- FragmentNavigationEventArgs.cs
- CommandBindingCollection.cs
- SafeMILHandleMemoryPressure.cs
- ToolboxItemFilterAttribute.cs