Code:
/ 4.0 / 4.0 / untmp / 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(SchemaElementLookUpTable lookUpTable)
{
_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
- DrawListViewItemEventArgs.cs
- InvokeWebServiceDesigner.cs
- FragmentQueryKB.cs
- GeneratedCodeAttribute.cs
- HyperLinkDesigner.cs
- LocalizationComments.cs
- ClientBuildManager.cs
- PeerNameRecord.cs
- Page.cs
- FontStretch.cs
- IdentityHolder.cs
- Setter.cs
- DataSourceView.cs
- CollectionBase.cs
- DisableDpiAwarenessAttribute.cs
- ReadOnlyHierarchicalDataSourceView.cs
- ConfigXmlWhitespace.cs
- DataGridViewCellStyleContentChangedEventArgs.cs
- DefaultTextStore.cs
- FlowSwitchDesigner.xaml.cs
- EncoderFallback.cs
- TemplatePagerField.cs
- PathGradientBrush.cs
- TextMarkerSource.cs
- RewritingValidator.cs
- ReachSerializerAsync.cs
- AuthenticateEventArgs.cs
- DebugView.cs
- MemoryMappedViewAccessor.cs
- Visual3D.cs
- TextAction.cs
- CultureInfoConverter.cs
- WebMessageEncoderFactory.cs
- ExpandSegmentCollection.cs
- ThrowOnMultipleAssignment.cs
- SynchronizationLockException.cs
- StaticResourceExtension.cs
- Buffer.cs
- DataGridColumnCollection.cs
- ProvideValueServiceProvider.cs
- XmlDataDocument.cs
- UnauthorizedWebPart.cs
- CodeEventReferenceExpression.cs
- TrustManagerMoreInformation.cs
- SaveFileDialog.cs
- WeakReferenceEnumerator.cs
- DecimalStorage.cs
- CopyCodeAction.cs
- TreeNode.cs
- CheckBoxDesigner.cs
- TextServicesContext.cs
- MediaSystem.cs
- ObjectSet.cs
- DataGridBoolColumn.cs
- StartUpEventArgs.cs
- ProcessModelInfo.cs
- TextServicesManager.cs
- EditorPartCollection.cs
- Wrapper.cs
- ScrollBarAutomationPeer.cs
- IQueryable.cs
- GC.cs
- SafeSystemMetrics.cs
- WebPartConnectionsCancelVerb.cs
- ControlType.cs
- ViewCellRelation.cs
- StreamAsIStream.cs
- XmlSchemaValidator.cs
- EffectiveValueEntry.cs
- BrowserDefinition.cs
- SQLMoney.cs
- SubtreeProcessor.cs
- ViewSimplifier.cs
- PictureBox.cs
- RunInstallerAttribute.cs
- TrackingMemoryStreamFactory.cs
- QilVisitor.cs
- RepeatEnumerable.cs
- CheckPair.cs
- LayoutEngine.cs
- KnownBoxes.cs
- XmlMtomWriter.cs
- __FastResourceComparer.cs
- GenericTypeParameterBuilder.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- CodeGenerator.cs
- TrustManagerPromptUI.cs
- AppSettingsReader.cs
- Vector3DIndependentAnimationStorage.cs
- DecimalConstantAttribute.cs
- PageFunction.cs
- CodeTypeReferenceExpression.cs
- HttpRequestCacheValidator.cs
- PropertyEmitterBase.cs
- Trustee.cs
- KeySplineConverter.cs
- DataGridItemAttachedStorage.cs
- LinkGrep.cs
- ResourceLoader.cs
- XmlSchemaAttribute.cs