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
- NullExtension.cs
- ExtensionQuery.cs
- ActivityExecutorSurrogate.cs
- HostedTransportConfigurationBase.cs
- DocumentOrderQuery.cs
- DiscoveryViaBehavior.cs
- StateBag.cs
- Command.cs
- OleDbException.cs
- WorkflowOperationAsyncResult.cs
- UrlAuthFailureHandler.cs
- DataBindingList.cs
- ProcessManager.cs
- SoapReflectionImporter.cs
- TransactionBridgeSection.cs
- X509Extension.cs
- BulletedList.cs
- FtpCachePolicyElement.cs
- FillBehavior.cs
- RenderDataDrawingContext.cs
- TextEffectResolver.cs
- InProcStateClientManager.cs
- TypeDescriptorFilterService.cs
- OpacityConverter.cs
- MappingModelBuildProvider.cs
- AssemblyBuilder.cs
- ListViewItemMouseHoverEvent.cs
- StyleCollectionEditor.cs
- GuidelineSet.cs
- CalendarDateChangedEventArgs.cs
- XmlSchemaAttributeGroup.cs
- SafeRightsManagementPubHandle.cs
- RichTextBoxAutomationPeer.cs
- ListViewGroupItemCollection.cs
- ExtensionQuery.cs
- RefreshInfo.cs
- dtdvalidator.cs
- FixedTextContainer.cs
- BamlTreeUpdater.cs
- ScriptingScriptResourceHandlerSection.cs
- CodeSubDirectory.cs
- X509CertificateStore.cs
- Model3DGroup.cs
- SerializerDescriptor.cs
- CompiledIdentityConstraint.cs
- InputDevice.cs
- DataGridViewRowCollection.cs
- DesignerActionHeaderItem.cs
- Int32Rect.cs
- GridViewSortEventArgs.cs
- GridToolTip.cs
- AdornerHitTestResult.cs
- CalendarDesigner.cs
- CapiSymmetricAlgorithm.cs
- DataSourceIDConverter.cs
- BindValidationContext.cs
- DataGridViewRow.cs
- ExpressionStringBuilder.cs
- FixedTextBuilder.cs
- Expander.cs
- IconEditor.cs
- XmlKeywords.cs
- ConstNode.cs
- GlyphingCache.cs
- CompilerErrorCollection.cs
- TrustLevelCollection.cs
- AnnotationHelper.cs
- ProfileGroupSettingsCollection.cs
- WebPartMovingEventArgs.cs
- RequestSecurityToken.cs
- ScaleTransform.cs
- _CacheStreams.cs
- XPathEmptyIterator.cs
- XD.cs
- CompositeActivityValidator.cs
- TextRangeAdaptor.cs
- ColumnHeader.cs
- AsyncResult.cs
- DSACryptoServiceProvider.cs
- WindowsBrush.cs
- StatusBarAutomationPeer.cs
- MessageLoggingFilterTraceRecord.cs
- ReadOnlyDataSource.cs
- ModelUIElement3D.cs
- BinaryParser.cs
- EnvironmentPermission.cs
- CmsInterop.cs
- InputScopeConverter.cs
- DynamicObjectAccessor.cs
- PersonalizationAdministration.cs
- Clipboard.cs
- IList.cs
- SR.cs
- serverconfig.cs
- XmlTextReaderImpl.cs
- Cursor.cs
- DataGridViewCellConverter.cs
- DbException.cs
- ButtonBase.cs
- FormsAuthenticationModule.cs