Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / DataEntity / System / Data / EntityModel / SchemaObjectModel / FilteredSchemaElementLookUpTable.cs / 3 / FilteredSchemaElementLookUpTable.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using System; using System.Collections; using System.Collections.Generic; using System.Data; namespace System.Data.EntityModel.SchemaObjectModel { ////// Summary description for FilteredSchemaTypes. /// internal sealed class FilteredSchemaElementLookUpTable: IEnumerable , ISchemaElementLookUpTable where T : S where S : SchemaElement { #region Instance Fields private SchemaElementLookUpTable _lookUpTable = null; #endregion #region Public Methods ////// /// /// public FilteredSchemaElementLookUpTable(SchemaElementLookUpTablelookUpTable) { _lookUpTable = lookUpTable; } ////// /// ///public IEnumerator GetEnumerator() { return _lookUpTable.GetFilteredEnumerator (); } /// /// /// ///IEnumerator System.Collections.IEnumerable.GetEnumerator() { return _lookUpTable.GetFilteredEnumerator (); } /// /// /// public int Count { get { int count = 0; foreach ( SchemaElement element in _lookUpTable ) { if ( element is T ) { ++count; } } return count; } } ////// /// /// ///public bool ContainsKey(string key) { if ( !_lookUpTable.ContainsKey(key) ) return false; return _lookUpTable[key] as T != null; } /// /// /// public T this[string key] { get { S element = _lookUpTable[key]; if ( element == null ) { return null; } T elementAsT = element as T; if ( elementAsT != null ) { return elementAsT; } throw EntityUtil.InvalidOperation(System.Data.Entity.Strings.UnexpectedTypeInCollection(element.GetType(),key)); } } ////// /// /// ///public T LookUpEquivalentKey(string key) { return _lookUpTable.LookUpEquivalentKey(key) as T; } #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.Data; namespace System.Data.EntityModel.SchemaObjectModel { ////// Summary description for FilteredSchemaTypes. /// internal sealed class FilteredSchemaElementLookUpTable: IEnumerable , ISchemaElementLookUpTable where T : S where S : SchemaElement { #region Instance Fields private SchemaElementLookUpTable _lookUpTable = null; #endregion #region Public Methods ////// /// /// public FilteredSchemaElementLookUpTable(SchemaElementLookUpTablelookUpTable) { _lookUpTable = lookUpTable; } ////// /// ///public IEnumerator GetEnumerator() { return _lookUpTable.GetFilteredEnumerator (); } /// /// /// ///IEnumerator System.Collections.IEnumerable.GetEnumerator() { return _lookUpTable.GetFilteredEnumerator (); } /// /// /// public int Count { get { int count = 0; foreach ( SchemaElement element in _lookUpTable ) { if ( element is T ) { ++count; } } return count; } } ////// /// /// ///public bool ContainsKey(string key) { if ( !_lookUpTable.ContainsKey(key) ) return false; return _lookUpTable[key] as T != null; } /// /// /// public T this[string key] { get { S element = _lookUpTable[key]; if ( element == null ) { return null; } T elementAsT = element as T; if ( elementAsT != null ) { return elementAsT; } throw EntityUtil.InvalidOperation(System.Data.Entity.Strings.UnexpectedTypeInCollection(element.GetType(),key)); } } ////// /// /// ///public T LookUpEquivalentKey(string key) { return _lookUpTable.LookUpEquivalentKey(key) as T; } #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
- coordinator.cs
- ReaderWriterLock.cs
- MultipartContentParser.cs
- FormsAuthenticationTicket.cs
- NativeMethods.cs
- XmlTextReaderImplHelpers.cs
- PackUriHelper.cs
- TextElementCollectionHelper.cs
- WebPartsPersonalizationAuthorization.cs
- PresentationSource.cs
- DynamicObjectAccessor.cs
- ExpandButtonVisibilityConverter.cs
- ToolBar.cs
- LinearGradientBrush.cs
- InstanceLockQueryResult.cs
- CodeCompiler.cs
- RangeContentEnumerator.cs
- UnmanagedBitmapWrapper.cs
- VirtualizedItemPattern.cs
- CharacterHit.cs
- DropShadowBitmapEffect.cs
- XmlChildNodes.cs
- DesignTimeTemplateParser.cs
- State.cs
- SubpageParagraph.cs
- PerfCounters.cs
- AbstractSvcMapFileLoader.cs
- DataGridColumn.cs
- BaseCollection.cs
- LineVisual.cs
- ReaderWriterLock.cs
- AdPostCacheSubstitution.cs
- SelectionProviderWrapper.cs
- tibetanshape.cs
- GenericsInstances.cs
- QfeChecker.cs
- ServiceDesigner.cs
- ToolStripDesignerAvailabilityAttribute.cs
- XmlSchemaAttribute.cs
- ParenthesizePropertyNameAttribute.cs
- ThreadAttributes.cs
- AppDomainFactory.cs
- PanelStyle.cs
- ZipIOBlockManager.cs
- RSAOAEPKeyExchangeDeformatter.cs
- ObjectRef.cs
- StandardToolWindows.cs
- CodeDelegateCreateExpression.cs
- SafeRightsManagementHandle.cs
- MarginsConverter.cs
- AbstractSvcMapFileLoader.cs
- PageCache.cs
- PeerObject.cs
- TimeSpanStorage.cs
- StoragePropertyMapping.cs
- SQLDateTimeStorage.cs
- MobileControlsSectionHelper.cs
- CodeAttributeDeclaration.cs
- PropVariant.cs
- EdmValidator.cs
- SqlBuffer.cs
- SectionUpdates.cs
- EncodingInfo.cs
- ColorTranslator.cs
- ProfileSection.cs
- Mouse.cs
- ExecutionContext.cs
- FixedStringLookup.cs
- TemplateAction.cs
- ContainerTracking.cs
- Exception.cs
- InkPresenter.cs
- ObjectViewListener.cs
- TableLayoutRowStyleCollection.cs
- LinkLabel.cs
- MenuCommand.cs
- LinqToSqlWrapper.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- ArgumentOutOfRangeException.cs
- CompatibleComparer.cs
- ScrollData.cs
- EnlistmentState.cs
- RelatedImageListAttribute.cs
- ServerTooBusyException.cs
- TypeCodeDomSerializer.cs
- CurrencyWrapper.cs
- PageContent.cs
- Sql8ExpressionRewriter.cs
- WpfKnownType.cs
- RIPEMD160Managed.cs
- Hyperlink.cs
- InputReferenceExpression.cs
- RegisteredDisposeScript.cs
- MSAAEventDispatcher.cs
- TextRunCacheImp.cs
- UnknownBitmapDecoder.cs
- SafeViewOfFileHandle.cs
- ZipIOCentralDirectoryBlock.cs
- XmlNavigatorFilter.cs
- ExpressionTable.cs