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(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.
//----------------------------------------------------------------------
//
// 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
- BinaryObjectWriter.cs
- ProxyGenerationError.cs
- ChangeDirector.cs
- SmiSettersStream.cs
- BufferModesCollection.cs
- SpeakProgressEventArgs.cs
- MultiPageTextView.cs
- _UriTypeConverter.cs
- TokenBasedSetEnumerator.cs
- Attributes.cs
- EncoderReplacementFallback.cs
- storepermission.cs
- StylusPointCollection.cs
- EarlyBoundInfo.cs
- XamlStackWriter.cs
- FindCriteriaApril2005.cs
- AppDomainFactory.cs
- FixedSOMTableRow.cs
- GridItemPatternIdentifiers.cs
- TagElement.cs
- WizardForm.cs
- CodeAttributeDeclaration.cs
- SqlMethodTransformer.cs
- CodeGroup.cs
- EUCJPEncoding.cs
- ScaleTransform3D.cs
- TokenizerHelper.cs
- BamlMapTable.cs
- DefaultHttpHandler.cs
- TickBar.cs
- WorkflowView.cs
- StopStoryboard.cs
- MergePropertyDescriptor.cs
- ValueProviderWrapper.cs
- ColumnClickEvent.cs
- StylusLogic.cs
- ConfigurationPropertyCollection.cs
- Decoder.cs
- TableLayoutStyle.cs
- SystemIPAddressInformation.cs
- PageHandlerFactory.cs
- FloaterParaClient.cs
- ThumbAutomationPeer.cs
- ReflectionUtil.cs
- TextOutput.cs
- ButtonFlatAdapter.cs
- JavaScriptSerializer.cs
- WindowsListViewGroup.cs
- DataColumnCollection.cs
- ClientTargetSection.cs
- HashCryptoHandle.cs
- OrCondition.cs
- FilteredXmlReader.cs
- DbFunctionCommandTree.cs
- XmlSchemaSubstitutionGroup.cs
- PointCollectionValueSerializer.cs
- DiffuseMaterial.cs
- PageThemeCodeDomTreeGenerator.cs
- ServiceInstanceProvider.cs
- SystemIPv6InterfaceProperties.cs
- ButtonBaseAdapter.cs
- Authorization.cs
- NullEntityWrapper.cs
- HttpServerUtilityWrapper.cs
- DbConnectionPool.cs
- StringArrayConverter.cs
- FileStream.cs
- Table.cs
- DocumentsTrace.cs
- MethodToken.cs
- oledbmetadatacolumnnames.cs
- ServiceMemoryGates.cs
- ClientConfigPaths.cs
- SoapConverter.cs
- Base64WriteStateInfo.cs
- ImageListStreamer.cs
- SessionEndedEventArgs.cs
- ContextMenu.cs
- SimpleType.cs
- X509IssuerSerialKeyIdentifierClause.cs
- MetadataException.cs
- NonParentingControl.cs
- HttpListenerRequestUriBuilder.cs
- BookmarkEventArgs.cs
- FigureParaClient.cs
- DataChangedEventManager.cs
- XmlSchemaSimpleType.cs
- URL.cs
- SecUtil.cs
- Application.cs
- HtmlInputButton.cs
- WaitHandle.cs
- SafeThemeHandle.cs
- EntityDesignerUtils.cs
- WindowPattern.cs
- DataMember.cs
- SortedList.cs
- SurrogateDataContract.cs
- ChildrenQuery.cs
- LicenseException.cs