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
- AtomServiceDocumentSerializer.cs
- WinEventTracker.cs
- AuthenticationSchemesHelper.cs
- UnmanagedMemoryAccessor.cs
- Span.cs
- dataSvcMapFileLoader.cs
- MimeTypeMapper.cs
- IgnorePropertiesAttribute.cs
- securestring.cs
- _BufferOffsetSize.cs
- BufferModesCollection.cs
- ExpressionNormalizer.cs
- WebContext.cs
- ContainerUtilities.cs
- Window.cs
- XmlDeclaration.cs
- OLEDB_Enum.cs
- OdbcConnectionString.cs
- DisposableCollectionWrapper.cs
- ToolStripSeparatorRenderEventArgs.cs
- WindowShowOrOpenTracker.cs
- SyndicationSerializer.cs
- GradientSpreadMethodValidation.cs
- WebColorConverter.cs
- RoleGroupCollection.cs
- TypeElementCollection.cs
- RenderTargetBitmap.cs
- TextChangedEventArgs.cs
- ToolBarPanel.cs
- XmlUnspecifiedAttribute.cs
- CallContext.cs
- HttpRequest.cs
- HtmlInputRadioButton.cs
- DefinitionProperties.cs
- MsmqReceiveParameters.cs
- TemplateControlBuildProvider.cs
- SafeProcessHandle.cs
- BinaryObjectInfo.cs
- CompilerGlobalScopeAttribute.cs
- CompositeCollectionView.cs
- ExtendedProtectionPolicyTypeConverter.cs
- WindowsToolbarAsMenu.cs
- DataBindingCollectionEditor.cs
- ColorMatrix.cs
- SoapFault.cs
- FolderLevelBuildProviderAppliesToAttribute.cs
- ListViewUpdateEventArgs.cs
- TriState.cs
- AndCondition.cs
- StandardTransformFactory.cs
- Guid.cs
- KnownColorTable.cs
- StorageFunctionMapping.cs
- SqlNodeAnnotation.cs
- ElementMarkupObject.cs
- PackUriHelper.cs
- ListMarkerSourceInfo.cs
- SizeKeyFrameCollection.cs
- DataGridCellAutomationPeer.cs
- WebPartVerbCollection.cs
- ForceCopyBuildProvider.cs
- EventHandlerList.cs
- ArrangedElement.cs
- XPathItem.cs
- Clipboard.cs
- ElementProxy.cs
- ProfileModule.cs
- DataControlLinkButton.cs
- CellLabel.cs
- ApplicationException.cs
- ScriptReference.cs
- AttributeAction.cs
- ExpressionPrefixAttribute.cs
- BitmapPalettes.cs
- GenericTypeParameterBuilder.cs
- RelativeSource.cs
- HostedNamedPipeTransportManager.cs
- ImageList.cs
- DrawToolTipEventArgs.cs
- FixedPageAutomationPeer.cs
- BaseParser.cs
- SqlClientWrapperSmiStream.cs
- CapacityStreamGeometryContext.cs
- DataKeyCollection.cs
- ConfigXmlText.cs
- CommandEventArgs.cs
- CharAnimationBase.cs
- MatrixValueSerializer.cs
- HttpCacheParams.cs
- TextElementCollection.cs
- StringAttributeCollection.cs
- Funcletizer.cs
- AdornerPresentationContext.cs
- EntityDataSourceColumn.cs
- DictionaryTraceRecord.cs
- BrowserDefinitionCollection.cs
- ConsoleEntryPoint.cs
- dtdvalidator.cs
- TextParentUndoUnit.cs
- SubclassTypeValidatorAttribute.cs