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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DataGridViewRowsRemovedEventArgs.cs
- FocusTracker.cs
- TemplatedMailWebEventProvider.cs
- SrgsSemanticInterpretationTag.cs
- ImageIndexConverter.cs
- COM2AboutBoxPropertyDescriptor.cs
- MenuItem.cs
- _SingleItemRequestCache.cs
- TransferMode.cs
- StateMachineAction.cs
- NameValueSectionHandler.cs
- DataListCommandEventArgs.cs
- ProviderConnectionPointCollection.cs
- NavigationService.cs
- DataSourceXmlSerializationAttribute.cs
- SchemaContext.cs
- Timer.cs
- ComplexLine.cs
- EmptyCollection.cs
- SqlAliasesReferenced.cs
- Hex.cs
- ElementNotAvailableException.cs
- DiscoveryClientBindingElement.cs
- XmlArrayItemAttributes.cs
- ReadWriteObjectLock.cs
- X509Extension.cs
- ComPlusDiagnosticTraceSchemas.cs
- HttpVersion.cs
- HwndSourceParameters.cs
- GacUtil.cs
- PropertyGrid.cs
- HttpCacheVaryByContentEncodings.cs
- VisualState.cs
- DataGridPageChangedEventArgs.cs
- HtmlContainerControl.cs
- ScriptManagerProxy.cs
- Line.cs
- CryptoApi.cs
- EntityDesignerBuildProvider.cs
- SystemIPGlobalStatistics.cs
- TileModeValidation.cs
- ByteConverter.cs
- Point.cs
- ContentPlaceHolder.cs
- MenuBindingsEditor.cs
- ManagedIStream.cs
- WebReferencesBuildProvider.cs
- EventBuilder.cs
- xmlformatgeneratorstatics.cs
- Receive.cs
- SafeLibraryHandle.cs
- mansign.cs
- ToolstripProfessionalRenderer.cs
- Size3D.cs
- ListBox.cs
- ObjectIDGenerator.cs
- MouseDevice.cs
- WebResourceAttribute.cs
- ConversionContext.cs
- RootProfilePropertySettingsCollection.cs
- MobileDeviceCapabilitiesSectionHandler.cs
- BamlRecords.cs
- UnmanagedMarshal.cs
- ActivityTypeDesigner.xaml.cs
- SystemWebSectionGroup.cs
- Quad.cs
- HttpInputStream.cs
- X509IssuerSerialKeyIdentifierClause.cs
- ConsoleEntryPoint.cs
- ScopedMessagePartSpecification.cs
- GeneratedContractType.cs
- DateTimePicker.cs
- SinglePhaseEnlistment.cs
- HttpConfigurationContext.cs
- OracleBFile.cs
- Operator.cs
- ConnectionManagementElement.cs
- latinshape.cs
- SafeArrayRankMismatchException.cs
- NCryptNative.cs
- WindowsFormsLinkLabel.cs
- WriteFileContext.cs
- AddInServer.cs
- XPathQilFactory.cs
- SourceElementsCollection.cs
- WebBrowserNavigatingEventHandler.cs
- FormatVersion.cs
- WebPartPersonalization.cs
- ToolStripGrip.cs
- SqlConnectionPoolProviderInfo.cs
- xmlglyphRunInfo.cs
- MsmqIntegrationMessageProperty.cs
- FormViewPagerRow.cs
- EmptyReadOnlyDictionaryInternal.cs
- XsltFunctions.cs
- TranslateTransform.cs
- BamlVersionHeader.cs
- FixedSOMTable.cs
- InfoCardListRequest.cs
- InvalidEnumArgumentException.cs