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
- DataControlCommands.cs
- WebPartVerb.cs
- EntityConnectionStringBuilderItem.cs
- FacetValueContainer.cs
- MD5CryptoServiceProvider.cs
- ObjectDataSourceMethodEventArgs.cs
- ExpressionNormalizer.cs
- DictionaryContent.cs
- ConnectionStringSettingsCollection.cs
- StaticContext.cs
- AttributeEmitter.cs
- RuleSettings.cs
- WriteableBitmap.cs
- XmlElementAttributes.cs
- StatusBarItem.cs
- LockedActivityGlyph.cs
- CompiledXpathExpr.cs
- DataGridViewElement.cs
- EntityDataSourceContextDisposingEventArgs.cs
- HWStack.cs
- SecurityTokenReferenceStyle.cs
- ListViewEditEventArgs.cs
- WSDualHttpSecurity.cs
- TraceHandler.cs
- InfoCardRSAPKCS1SignatureDeformatter.cs
- Vector3DCollection.cs
- XamlStream.cs
- Pick.cs
- Vector3DAnimation.cs
- HtmlHistory.cs
- ZipIORawDataFileBlock.cs
- FileDialog.cs
- DoubleAnimationBase.cs
- QilValidationVisitor.cs
- AdornerPresentationContext.cs
- TabControl.cs
- HebrewCalendar.cs
- SecurityTokenRequirement.cs
- SuppressIldasmAttribute.cs
- ResXFileRef.cs
- RenderDataDrawingContext.cs
- Inflater.cs
- SchemaImporterExtension.cs
- SqlGatherConsumedAliases.cs
- ConfigurationPropertyAttribute.cs
- EditorReuseAttribute.cs
- OdbcFactory.cs
- EntityContainerEmitter.cs
- QuaternionAnimation.cs
- ConfigurationManager.cs
- ButtonColumn.cs
- PersonalizationState.cs
- ProjectionAnalyzer.cs
- ZoomPercentageConverter.cs
- WorkflowViewManager.cs
- ServiceAppDomainAssociationProvider.cs
- ContextMarshalException.cs
- GacUtil.cs
- DesignerActionUIStateChangeEventArgs.cs
- EpmAttributeNameBuilder.cs
- RowToParametersTransformer.cs
- PostBackTrigger.cs
- DomainLiteralReader.cs
- ProvidePropertyAttribute.cs
- ContentOperations.cs
- InkPresenterAutomationPeer.cs
- DocumentGrid.cs
- Baml2006ReaderSettings.cs
- DataObjectAttribute.cs
- RuleRef.cs
- QuotedPrintableStream.cs
- CryptoStream.cs
- DataBindEngine.cs
- QilPatternFactory.cs
- SizeFConverter.cs
- TrackBarRenderer.cs
- DesignerToolboxInfo.cs
- Dynamic.cs
- CultureInfoConverter.cs
- DataGridAutoGeneratingColumnEventArgs.cs
- DynamicEndpointElement.cs
- SafeBitVector32.cs
- DataGridViewAdvancedBorderStyle.cs
- OutputWindow.cs
- configsystem.cs
- COM2IManagedPerPropertyBrowsingHandler.cs
- ForAllOperator.cs
- FormViewInsertEventArgs.cs
- ApplicationDirectory.cs
- StylusLogic.cs
- DynamicObject.cs
- LocalServiceSecuritySettingsElement.cs
- ExpressionDumper.cs
- PropertyIDSet.cs
- BuildManager.cs
- NamedPipeTransportElement.cs
- MultiSelector.cs
- StartFileNameEditor.cs
- AxHost.cs
- CatalogPartCollection.cs