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
- TemplatedWizardStep.cs
- ExtendedPropertyCollection.cs
- LazyTextWriterCreator.cs
- RangeContentEnumerator.cs
- OrderedDictionaryStateHelper.cs
- ResetableIterator.cs
- SignatureResourcePool.cs
- figurelength.cs
- GridViewRowCollection.cs
- OracleFactory.cs
- XmlSchemaInclude.cs
- wgx_commands.cs
- MetadataExchangeClient.cs
- SafeViewOfFileHandle.cs
- RegexNode.cs
- documentation.cs
- SQLStringStorage.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- HealthMonitoringSection.cs
- RoleGroup.cs
- ProcessModule.cs
- InfoCardBinaryReader.cs
- DataGridViewColumnStateChangedEventArgs.cs
- InternalDuplexBindingElement.cs
- DomainUpDown.cs
- CodeBinaryOperatorExpression.cs
- DashStyle.cs
- SQLInt64Storage.cs
- EraserBehavior.cs
- PeerConnector.cs
- ProjectionPlanCompiler.cs
- DataMemberFieldConverter.cs
- LicenseContext.cs
- OleDbMetaDataFactory.cs
- InvokeDelegate.cs
- SqlXmlStorage.cs
- ObjectStateEntry.cs
- ThicknessAnimationBase.cs
- MimeObjectFactory.cs
- PointCollection.cs
- NavigationHelper.cs
- ProfileSettingsCollection.cs
- XmlReflectionMember.cs
- HelpProvider.cs
- ImageList.cs
- ComponentSerializationService.cs
- DataGridCellInfo.cs
- securitycriticaldataClass.cs
- BitmapEffectrendercontext.cs
- KeySplineConverter.cs
- ClientScriptManagerWrapper.cs
- SpotLight.cs
- SqlAliasesReferenced.cs
- _HeaderInfo.cs
- SystemFonts.cs
- controlskin.cs
- MarkupWriter.cs
- PropertyIDSet.cs
- EmptyImpersonationContext.cs
- FreeFormDesigner.cs
- Int32CollectionValueSerializer.cs
- DataColumnPropertyDescriptor.cs
- ObjectToIdCache.cs
- querybuilder.cs
- PageCodeDomTreeGenerator.cs
- FontCollection.cs
- BaseCAMarshaler.cs
- StringComparer.cs
- StorageMappingItemCollection.cs
- BaseHashHelper.cs
- UniqueEventHelper.cs
- RemotingException.cs
- XmlComplianceUtil.cs
- UIElement.cs
- IndentedWriter.cs
- TableCellAutomationPeer.cs
- ConnectionPoint.cs
- TranslateTransform.cs
- ViewRendering.cs
- ISFTagAndGuidCache.cs
- StringTraceRecord.cs
- XmlWellformedWriter.cs
- UnsafeNativeMethodsMilCoreApi.cs
- DataServiceClientException.cs
- WebPartAuthorizationEventArgs.cs
- HttpCapabilitiesEvaluator.cs
- PagesChangedEventArgs.cs
- RadialGradientBrush.cs
- TcpDuplicateContext.cs
- FontSourceCollection.cs
- CloudCollection.cs
- Iis7Helper.cs
- UserNameSecurityTokenProvider.cs
- dtdvalidator.cs
- UriTemplateEquivalenceComparer.cs
- M3DUtil.cs
- ToolStripOverflowButton.cs
- GetPageNumberCompletedEventArgs.cs
- EventlogProvider.cs
- StylusPoint.cs