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
- RecordsAffectedEventArgs.cs
- HttpListenerResponse.cs
- OpacityConverter.cs
- DataGridColumnHeader.cs
- HorizontalAlignConverter.cs
- SeverityFilter.cs
- BamlRecords.cs
- ProcessThreadCollection.cs
- SspiSafeHandles.cs
- SplitterEvent.cs
- TreePrinter.cs
- DockAndAnchorLayout.cs
- MemberListBinding.cs
- PipelineModuleStepContainer.cs
- ValidatedControlConverter.cs
- FileLevelControlBuilderAttribute.cs
- RotateTransform.cs
- DataGridrowEditEndingEventArgs.cs
- TryExpression.cs
- CustomError.cs
- SQLMoneyStorage.cs
- RangeContentEnumerator.cs
- TextTreeRootNode.cs
- ListenerHandler.cs
- LogoValidationException.cs
- FieldNameLookup.cs
- ActivityLocationReferenceEnvironment.cs
- EpmTargetPathSegment.cs
- log.cs
- WebPartConnectionsConfigureVerb.cs
- ListComponentEditor.cs
- Attributes.cs
- SafeUserTokenHandle.cs
- CodeCommentStatementCollection.cs
- Line.cs
- RoleService.cs
- MonitorWrapper.cs
- DataList.cs
- InvalidDataException.cs
- TextEmbeddedObject.cs
- WebExceptionStatus.cs
- CodeEventReferenceExpression.cs
- DataGridPagingPage.cs
- DataBindingList.cs
- SyntaxCheck.cs
- StyleXamlParser.cs
- VirtualPath.cs
- BuilderPropertyEntry.cs
- UrlParameterWriter.cs
- DataGridViewColumnEventArgs.cs
- DataGridViewRowsAddedEventArgs.cs
- DbParameterHelper.cs
- HandlerBase.cs
- EdmPropertyAttribute.cs
- RowToFieldTransformer.cs
- OdbcEnvironment.cs
- HttpValueCollection.cs
- CharConverter.cs
- DocumentViewerHelper.cs
- UrlPath.cs
- BoundField.cs
- FunctionImportMapping.ReturnTypeRenameMapping.cs
- TextBoxView.cs
- RelationshipNavigation.cs
- CommonGetThemePartSize.cs
- CurrencyManager.cs
- VisualTreeUtils.cs
- ConversionContext.cs
- ColorConverter.cs
- CompiledAction.cs
- securitycriticaldataClass.cs
- XmlElementCollection.cs
- FontStretch.cs
- TypedDataSetSchemaImporterExtension.cs
- LifetimeServices.cs
- CompiledELinqQueryState.cs
- XmlMemberMapping.cs
- Selection.cs
- newinstructionaction.cs
- MethodExpr.cs
- Stack.cs
- ComboBoxHelper.cs
- PriorityRange.cs
- SafeCoTaskMem.cs
- newitemfactory.cs
- Region.cs
- PointKeyFrameCollection.cs
- XPathDocumentIterator.cs
- DefaultBindingPropertyAttribute.cs
- NullableFloatAverageAggregationOperator.cs
- ContourSegment.cs
- RotateTransform.cs
- ConversionContext.cs
- SetterBase.cs
- XmlDownloadManager.cs
- Condition.cs
- DisableDpiAwarenessAttribute.cs
- GeometryHitTestResult.cs
- XmlSchemaSubstitutionGroup.cs
- SqlDataRecord.cs