Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / EntityModel / SchemaObjectModel / FilteredSchemaElementLookUpTable.cs / 1305376 / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- RegisteredScript.cs
- PeerIPHelper.cs
- BoolExpression.cs
- MetabaseServerConfig.cs
- OdbcParameterCollection.cs
- RegexRunner.cs
- LogicalTreeHelper.cs
- RC2.cs
- EncodingDataItem.cs
- DropShadowBitmapEffect.cs
- BufferedWebEventProvider.cs
- ListView.cs
- DependencyObjectType.cs
- CodeDomSerializerException.cs
- ToolStripArrowRenderEventArgs.cs
- DataGridTable.cs
- WindowPatternIdentifiers.cs
- Debug.cs
- _ScatterGatherBuffers.cs
- SecurityContextSecurityToken.cs
- AttachInfo.cs
- WebPartConnectionCollection.cs
- FloatAverageAggregationOperator.cs
- HashSetEqualityComparer.cs
- EntitySetDataBindingList.cs
- GenerateTemporaryTargetAssembly.cs
- SchemaTypeEmitter.cs
- ObjectQuery_EntitySqlExtensions.cs
- IOException.cs
- ItemChangedEventArgs.cs
- Keyboard.cs
- HttpCachePolicyElement.cs
- TypeBuilderInstantiation.cs
- ServiceReference.cs
- MutableAssemblyCacheEntry.cs
- FlowNode.cs
- TokenizerHelper.cs
- SQLString.cs
- ImmutablePropertyDescriptorGridEntry.cs
- ObjectTag.cs
- Wildcard.cs
- UnsafeNativeMethods.cs
- CqlIdentifiers.cs
- RecommendedAsConfigurableAttribute.cs
- TimelineClockCollection.cs
- SQLMembershipProvider.cs
- Literal.cs
- OptimalTextSource.cs
- ToolStripSystemRenderer.cs
- VoiceSynthesis.cs
- log.cs
- AnnotationResource.cs
- SchemaLookupTable.cs
- FlatButtonAppearance.cs
- ProtocolsConfiguration.cs
- AtomicFile.cs
- WorkItem.cs
- PrintDialogException.cs
- InteropAutomationProvider.cs
- ProvidersHelper.cs
- OutputCacheSettingsSection.cs
- ComplexLine.cs
- ClientUIRequest.cs
- TrackBarRenderer.cs
- DefaultPrintController.cs
- DocumentOrderQuery.cs
- TiffBitmapEncoder.cs
- Menu.cs
- DbParameterCollectionHelper.cs
- ToolConsole.cs
- PasswordRecovery.cs
- KeyInterop.cs
- IdentityNotMappedException.cs
- EventItfInfo.cs
- RowType.cs
- FirstMatchCodeGroup.cs
- GenericRootAutomationPeer.cs
- SortQuery.cs
- EllipseGeometry.cs
- GlyphElement.cs
- FieldBuilder.cs
- ColumnClickEvent.cs
- OutputCache.cs
- ToolboxItemImageConverter.cs
- AbstractSvcMapFileLoader.cs
- DesignerWidgets.cs
- CharStorage.cs
- SchemaMerger.cs
- NonSerializedAttribute.cs
- ActivityExecutionFilter.cs
- WebPartDisplayModeEventArgs.cs
- FigureParagraph.cs
- DecoratedNameAttribute.cs
- NullableBoolConverter.cs
- WebPart.cs
- ChildTable.cs
- PermissionToken.cs
- BamlWriter.cs
- SqlServices.cs
- PanelStyle.cs