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
- DataServiceRequestOfT.cs
- GenericTypeParameterBuilder.cs
- RuleSettingsCollection.cs
- HttpConfigurationSystem.cs
- BatchWriter.cs
- AsyncResult.cs
- DataBoundControl.cs
- BufferedStream.cs
- PolicyVersionConverter.cs
- GlobalItem.cs
- OSFeature.cs
- PriorityChain.cs
- SchemaMapping.cs
- WindowsTitleBar.cs
- TreeViewDesigner.cs
- WaitHandleCannotBeOpenedException.cs
- RewritingValidator.cs
- ColorConvertedBitmapExtension.cs
- DataColumnMappingCollection.cs
- Send.cs
- DesignerCalendarAdapter.cs
- ViewDesigner.cs
- Transform3D.cs
- DBSqlParser.cs
- ReversePositionQuery.cs
- Int32CAMarshaler.cs
- ListParagraph.cs
- DbConnectionPoolCounters.cs
- DataGridColumnFloatingHeader.cs
- TargetPerspective.cs
- QueryAccessibilityHelpEvent.cs
- CodeAttachEventStatement.cs
- DSACryptoServiceProvider.cs
- DataTableExtensions.cs
- GCHandleCookieTable.cs
- TargetConverter.cs
- DelegatedStream.cs
- RawStylusInputReport.cs
- DummyDataSource.cs
- CodeTypeReferenceCollection.cs
- EncodingInfo.cs
- BitmapMetadataBlob.cs
- EditingCoordinator.cs
- XmlAnyElementAttribute.cs
- ImportCatalogPart.cs
- DbConnectionPoolCounters.cs
- CryptoApi.cs
- CharacterShapingProperties.cs
- IndividualDeviceConfig.cs
- CngAlgorithmGroup.cs
- SessionEndingEventArgs.cs
- _StreamFramer.cs
- _BufferOffsetSize.cs
- LabelDesigner.cs
- SqlCacheDependencySection.cs
- ToolStripDropDownButton.cs
- CodeIndexerExpression.cs
- BasicKeyConstraint.cs
- InputEventArgs.cs
- SeparatorAutomationPeer.cs
- PrimitiveType.cs
- SqlBulkCopyColumnMappingCollection.cs
- log.cs
- SpellerStatusTable.cs
- RenderDataDrawingContext.cs
- CqlLexer.cs
- SystemIcons.cs
- XmlEntity.cs
- InstanceNormalEvent.cs
- SymbolDocumentGenerator.cs
- CustomValidator.cs
- DataTransferEventArgs.cs
- Properties.cs
- IntSecurity.cs
- RuleSettings.cs
- CustomError.cs
- XmlBinaryReader.cs
- NativeMethodsOther.cs
- ConfigXmlComment.cs
- _FixedSizeReader.cs
- GeometryValueSerializer.cs
- HtmlTableCellCollection.cs
- _MultipleConnectAsync.cs
- ChtmlLinkAdapter.cs
- UnsignedPublishLicense.cs
- LogicalTreeHelper.cs
- GeometryGroup.cs
- XmlSchemaAttribute.cs
- IndexedEnumerable.cs
- KeyInstance.cs
- EntityDescriptor.cs
- XmlSchemaType.cs
- HtmlWindow.cs
- PartDesigner.cs
- FolderBrowserDialog.cs
- Stylus.cs
- SQLGuid.cs
- ReferenceEqualityComparer.cs
- XamlPointCollectionSerializer.cs
- TimeSpanMinutesOrInfiniteConverter.cs