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
- EventEntry.cs
- TripleDES.cs
- CopyNamespacesAction.cs
- AssemblyHelper.cs
- SafeRegistryHandle.cs
- ToolStripRenderEventArgs.cs
- PointValueSerializer.cs
- CanonicalXml.cs
- HitTestDrawingContextWalker.cs
- ReadOnlyCollection.cs
- AssociationTypeEmitter.cs
- GridViewRowEventArgs.cs
- DataGridViewSelectedCellsAccessibleObject.cs
- DataGridColumnCollectionEditor.cs
- DelegateBodyWriter.cs
- TextPattern.cs
- LingerOption.cs
- RowParagraph.cs
- XmlLanguage.cs
- SQLDateTimeStorage.cs
- ScalarConstant.cs
- SafeEventLogWriteHandle.cs
- StatusBarAutomationPeer.cs
- Soap12ServerProtocol.cs
- ListViewPagedDataSource.cs
- DataGridColumnHeaderItemAutomationPeer.cs
- XmlSchemaSimpleTypeList.cs
- MetafileHeaderEmf.cs
- BitmapCodecInfoInternal.cs
- DetailsView.cs
- StorageComplexTypeMapping.cs
- LinqDataSource.cs
- DocumentSequenceHighlightLayer.cs
- DataGridViewLayoutData.cs
- PathStreamGeometryContext.cs
- NotifyInputEventArgs.cs
- Update.cs
- DataGridViewImageCell.cs
- StatusStrip.cs
- Form.cs
- SecurityResources.cs
- CodeCompiler.cs
- WebServiceHandlerFactory.cs
- ObjectStateEntry.cs
- FixedSOMLineRanges.cs
- VectorValueSerializer.cs
- SessionParameter.cs
- ContextActivityUtils.cs
- ServiceEndpoint.cs
- MessageEncodingBindingElementImporter.cs
- ConfigurationSectionGroup.cs
- PropertyGeneratedEventArgs.cs
- LastQueryOperator.cs
- XmlEncodedRawTextWriter.cs
- Effect.cs
- ProgressBar.cs
- WsrmTraceRecord.cs
- PageContentAsyncResult.cs
- TextHintingModeValidation.cs
- StringPropertyBuilder.cs
- _Connection.cs
- ExceptionUtil.cs
- NotConverter.cs
- OleCmdHelper.cs
- SystemFonts.cs
- TextElementEnumerator.cs
- VisualState.cs
- DataControlPagerLinkButton.cs
- NestPullup.cs
- InputMethodStateChangeEventArgs.cs
- BooleanToVisibilityConverter.cs
- DataGrid.cs
- NumberFunctions.cs
- ListBoxChrome.cs
- CommandLibraryHelper.cs
- ContextMenuStrip.cs
- XmlSchemaInfo.cs
- ToolStripPanelDesigner.cs
- BookmarkEventArgs.cs
- XmlSerializerAssemblyAttribute.cs
- X509ServiceCertificateAuthentication.cs
- DateTime.cs
- CorrelationResolver.cs
- AttachedPropertyBrowsableAttribute.cs
- Section.cs
- DashStyle.cs
- precedingsibling.cs
- KeyPullup.cs
- XmlBinaryReader.cs
- QilSortKey.cs
- RuleSettings.cs
- PrintDocument.cs
- FileClassifier.cs
- Operand.cs
- PolyBezierSegment.cs
- MenuScrollingVisibilityConverter.cs
- Light.cs
- EntitySet.cs
- DataStorage.cs
- DataServiceOperationContext.cs