Code:
/ 4.0 / 4.0 / 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. //---------------------------------------------------------------------- // // 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
- AsyncOperation.cs
- Process.cs
- SqlInfoMessageEvent.cs
- EmptyEnumerator.cs
- XmlAttributeAttribute.cs
- UnsafeNativeMethods.cs
- QueryExecutionOption.cs
- WarningException.cs
- tooltip.cs
- WebSysDefaultValueAttribute.cs
- RequestContext.cs
- IncrementalReadDecoders.cs
- QilList.cs
- PropertyItem.cs
- BaseCollection.cs
- UrlMapping.cs
- DynamicQueryableWrapper.cs
- WebPartConnectVerb.cs
- XD.cs
- WrappedKeySecurityTokenParameters.cs
- WebPartTransformerCollection.cs
- IxmlLineInfo.cs
- FixedStringLookup.cs
- CodeTypeReference.cs
- MaterialCollection.cs
- DtdParser.cs
- XXXOnTypeBuilderInstantiation.cs
- ReaderContextStackData.cs
- TagPrefixAttribute.cs
- XmlnsCompatibleWithAttribute.cs
- CoreSwitches.cs
- FullTextBreakpoint.cs
- HierarchicalDataTemplate.cs
- ThreadExceptionDialog.cs
- ResourceCollectionInfo.cs
- SecureUICommand.cs
- TempFiles.cs
- DashStyle.cs
- KeyGestureValueSerializer.cs
- DataGridView.cs
- LabelTarget.cs
- PointAnimationUsingPath.cs
- UxThemeWrapper.cs
- ObjectViewQueryResultData.cs
- ValueProviderWrapper.cs
- ToolStripTextBox.cs
- ServicesUtilities.cs
- UserControl.cs
- DataTableReaderListener.cs
- _ConnectOverlappedAsyncResult.cs
- KeyboardNavigation.cs
- XmlArrayAttribute.cs
- Canvas.cs
- NavigationExpr.cs
- XmlDataSource.cs
- PasswordDeriveBytes.cs
- ConstrainedDataObject.cs
- TypeConverterValueSerializer.cs
- TransactionManager.cs
- WebOperationContext.cs
- ToolStripRenderEventArgs.cs
- LayoutTableCell.cs
- XmlParser.cs
- ClientSettingsStore.cs
- InkCanvasFeedbackAdorner.cs
- ValidationUtility.cs
- TabControl.cs
- UserInitiatedRoutedEventPermission.cs
- BigInt.cs
- OutOfMemoryException.cs
- Trace.cs
- SocketAddress.cs
- JoinElimination.cs
- CodeAssignStatement.cs
- TypeConverterAttribute.cs
- HwndStylusInputProvider.cs
- RetrieveVirtualItemEventArgs.cs
- CompilerScope.Storage.cs
- ContentType.cs
- UITypeEditors.cs
- ProcessManager.cs
- BamlLocalizer.cs
- DataGridViewCellValueEventArgs.cs
- Parameter.cs
- Utilities.cs
- ExpressionBuilderContext.cs
- BaseProcessProtocolHandler.cs
- Types.cs
- TypeInformation.cs
- CommonObjectSecurity.cs
- ControlPaint.cs
- ProgressBarAutomationPeer.cs
- Comparer.cs
- TypefaceMap.cs
- ImmutableObjectAttribute.cs
- FixedSOMTextRun.cs
- XmlTextEncoder.cs
- IODescriptionAttribute.cs
- DataGridViewMethods.cs
- DbConnectionPoolIdentity.cs