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
- ContentValidator.cs
- ContainerParaClient.cs
- XhtmlMobileTextWriter.cs
- Profiler.cs
- OdbcReferenceCollection.cs
- SqlHelper.cs
- SoapSchemaExporter.cs
- SrgsOneOf.cs
- Operator.cs
- LazyTextWriterCreator.cs
- CustomValidator.cs
- CombinedGeometry.cs
- TraceLog.cs
- ConfigsHelper.cs
- ConfigXmlCDataSection.cs
- WindowsToolbar.cs
- PasswordRecovery.cs
- KeyValuePair.cs
- ExportOptions.cs
- InputManager.cs
- ResourceReader.cs
- XmlSortKeyAccumulator.cs
- ConvertEvent.cs
- OracleInternalConnection.cs
- AutomationIdentifier.cs
- ApplicationHost.cs
- IDictionary.cs
- Converter.cs
- InvalidOleVariantTypeException.cs
- ObjectPersistData.cs
- PolicyLevel.cs
- DictionaryEntry.cs
- Pen.cs
- NavigationPropertyEmitter.cs
- X509CertificateValidator.cs
- PrePostDescendentsWalker.cs
- SourceLocation.cs
- VisualBasicExpressionConverter.cs
- PageCodeDomTreeGenerator.cs
- Executor.cs
- RuntimeHandles.cs
- Shared.cs
- XmlSchemaComplexContentRestriction.cs
- DataGridViewRow.cs
- EncryptedPackageFilter.cs
- EndOfStreamException.cs
- ArrayWithOffset.cs
- ViewValidator.cs
- MailFileEditor.cs
- SerialPinChanges.cs
- UnsupportedPolicyOptionsException.cs
- ExpressionVisitor.cs
- WebControlAdapter.cs
- DashStyle.cs
- EntityObject.cs
- InternalResources.cs
- SHA256.cs
- PagesSection.cs
- VectorConverter.cs
- ListBoxItemAutomationPeer.cs
- DataServiceQuery.cs
- ExpandSegment.cs
- TypeBuilderInstantiation.cs
- DataSpaceManager.cs
- Subordinate.cs
- DrawingBrush.cs
- RegexCaptureCollection.cs
- UInt32Storage.cs
- InstalledFontCollection.cs
- GenericTypeParameterBuilder.cs
- ReadOnlyHierarchicalDataSourceView.cs
- infer.cs
- SoapObjectReader.cs
- SubMenuStyle.cs
- MobileContainerDesigner.cs
- FastEncoder.cs
- XmlAutoDetectWriter.cs
- WindowsListViewGroup.cs
- SmtpSection.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- ToolStripComboBox.cs
- MetaType.cs
- HintTextMaxWidthConverter.cs
- EditorResources.cs
- OleDbTransaction.cs
- EndpointDiscoveryMetadata.cs
- DynamicValueConverter.cs
- CodeStatementCollection.cs
- StrokeNode.cs
- PopupRoot.cs
- NamespaceEmitter.cs
- CurrencyWrapper.cs
- ToolStripTextBox.cs
- StrokeDescriptor.cs
- InputBuffer.cs
- ProxyGenerationError.cs
- SafeUserTokenHandle.cs
- DataGridViewLinkColumn.cs
- DirectoryNotFoundException.cs
- Parser.cs