Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / DataEntity / System / Data / EntityModel / SchemaObjectModel / FilteredSchemaElementLookUpTable.cs / 3 / 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
- Point3DCollectionValueSerializer.cs
- DBConnection.cs
- SoapFormatter.cs
- DataGridViewRowPostPaintEventArgs.cs
- RtType.cs
- TextBoxRenderer.cs
- ListViewContainer.cs
- ItemContainerProviderWrapper.cs
- HttpCapabilitiesSectionHandler.cs
- TraceSection.cs
- ToolStripRenderer.cs
- GeneralTransformGroup.cs
- CustomSignedXml.cs
- ETagAttribute.cs
- ThrowHelper.cs
- ChannelManager.cs
- PnrpPermission.cs
- mactripleDES.cs
- PathParser.cs
- MarshalDirectiveException.cs
- LoaderAllocator.cs
- WeakRefEnumerator.cs
- HtmlDocument.cs
- SimpleFileLog.cs
- TcpConnectionPoolSettings.cs
- RegisteredHiddenField.cs
- RepeatInfo.cs
- WebServiceData.cs
- TdsValueSetter.cs
- ObjectParameter.cs
- Button.cs
- SymbolTable.cs
- DesignerLoader.cs
- SolidColorBrush.cs
- TabRenderer.cs
- TransformerConfigurationWizardBase.cs
- Button.cs
- AsyncPostBackErrorEventArgs.cs
- PrintControllerWithStatusDialog.cs
- ChtmlMobileTextWriter.cs
- AmbientValueAttribute.cs
- WinInetCache.cs
- ImageFormatConverter.cs
- Enum.cs
- RawTextInputReport.cs
- AndMessageFilterTable.cs
- CodeMethodReturnStatement.cs
- EditorAttributeInfo.cs
- Stopwatch.cs
- EmbossBitmapEffect.cs
- ListViewSortEventArgs.cs
- BinaryUtilClasses.cs
- BamlMapTable.cs
- SrgsElement.cs
- TTSVoice.cs
- PositiveTimeSpanValidator.cs
- EpmCustomContentDeSerializer.cs
- TextServicesCompartment.cs
- DataBoundControlDesigner.cs
- GPStream.cs
- EventProvider.cs
- Storyboard.cs
- SymmetricAlgorithm.cs
- VSWCFServiceContractGenerator.cs
- DetailsViewUpdateEventArgs.cs
- Single.cs
- ListBox.cs
- DateTimeConverter.cs
- ChangeTracker.cs
- _UriTypeConverter.cs
- XmlNamespaceDeclarationsAttribute.cs
- WebPartConnectionsCancelVerb.cs
- TransformerInfoCollection.cs
- CompareInfo.cs
- BuildProviderCollection.cs
- ErrorFormatterPage.cs
- ApplicationCommands.cs
- XmlBufferReader.cs
- Brushes.cs
- AdCreatedEventArgs.cs
- Adorner.cs
- SqlConnectionPoolProviderInfo.cs
- XmlText.cs
- XmlSchemaAnyAttribute.cs
- RelationshipConverter.cs
- OAVariantLib.cs
- BehaviorService.cs
- RoleGroup.cs
- EntityStoreSchemaGenerator.cs
- CryptoProvider.cs
- __Error.cs
- AsyncPostBackTrigger.cs
- BrowserCapabilitiesCodeGenerator.cs
- XamlFilter.cs
- GenericQueueSurrogate.cs
- DoubleLinkListEnumerator.cs
- InfoCardRSAOAEPKeyExchangeFormatter.cs
- CultureInfo.cs
- Attributes.cs
- SQLCharsStorage.cs