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
- WebPartEditorCancelVerb.cs
- DataGridCaption.cs
- StringTraceRecord.cs
- MemberMaps.cs
- ImageSource.cs
- StylusEventArgs.cs
- WebPartEventArgs.cs
- RoutingService.cs
- ContextMenuAutomationPeer.cs
- ComponentConverter.cs
- SpecularMaterial.cs
- NamespaceTable.cs
- DefaultValueAttribute.cs
- FlowDocumentPageViewerAutomationPeer.cs
- DefaultPropertyAttribute.cs
- AuthenticationModuleElement.cs
- DnsPermission.cs
- NativeMethods.cs
- DelegateOutArgument.cs
- PropertyInformation.cs
- UnknownExceptionActionHelper.cs
- AdCreatedEventArgs.cs
- DataGridViewBindingCompleteEventArgs.cs
- AnnotationAdorner.cs
- Pair.cs
- QueryAccessibilityHelpEvent.cs
- CalendarAutoFormat.cs
- ReadOnlyHierarchicalDataSourceView.cs
- odbcmetadatafactory.cs
- UnionCqlBlock.cs
- EntityEntry.cs
- DataGridViewColumnDesigner.cs
- StylusPointProperty.cs
- AccessedThroughPropertyAttribute.cs
- ShaderEffect.cs
- MarkupObject.cs
- DataGrid.cs
- ChannelManager.cs
- AutomationPatternInfo.cs
- SerializationObjectManager.cs
- BehaviorService.cs
- Marshal.cs
- DesignBinding.cs
- RSAOAEPKeyExchangeFormatter.cs
- AuthorizationRule.cs
- Encoding.cs
- DispatcherExceptionFilterEventArgs.cs
- CurrentChangedEventManager.cs
- TrustLevel.cs
- StringComparer.cs
- DataGridDesigner.cs
- DataServiceKeyAttribute.cs
- Transform.cs
- AutoGeneratedField.cs
- TimeIntervalCollection.cs
- MultiView.cs
- SmtpMail.cs
- XamlGridLengthSerializer.cs
- NodeLabelEditEvent.cs
- CalendarDay.cs
- Registry.cs
- GridErrorDlg.cs
- SchemaNamespaceManager.cs
- ProtocolViolationException.cs
- DynamicResourceExtension.cs
- TextTreeNode.cs
- SessionPageStateSection.cs
- Thickness.cs
- AuthenticationSchemesHelper.cs
- SecurityUtils.cs
- HttpListenerContext.cs
- NullReferenceException.cs
- PropertyCondition.cs
- BatchWriter.cs
- Geometry.cs
- ReadingWritingEntityEventArgs.cs
- HttpProfileBase.cs
- CommandLibraryHelper.cs
- TextEncodedRawTextWriter.cs
- DbProviderManifest.cs
- FamilyMap.cs
- LongValidatorAttribute.cs
- TemplatePropertyEntry.cs
- DecimalSumAggregationOperator.cs
- WeakEventTable.cs
- ObjectCloneHelper.cs
- ComEventsSink.cs
- ServiceCredentialsElement.cs
- VBIdentifierDesigner.xaml.cs
- MetafileHeaderWmf.cs
- MatrixConverter.cs
- Page.cs
- EnumValAlphaComparer.cs
- MessageQueuePermission.cs
- BrowserCapabilitiesCodeGenerator.cs
- PassportAuthenticationModule.cs
- CodeRegionDirective.cs
- GridViewUpdatedEventArgs.cs
- WebPartConnectionsCloseVerb.cs
- EndEvent.cs