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
- DeleteBookmarkScope.cs
- PipeStream.cs
- X500Name.cs
- SelectionRange.cs
- InfoCardX509Validator.cs
- ReferencedAssembly.cs
- CompareInfo.cs
- SolidBrush.cs
- PlainXmlDeserializer.cs
- EncryptedKeyIdentifierClause.cs
- GridItemProviderWrapper.cs
- MembershipUser.cs
- EntityContainerEmitter.cs
- OleDbConnection.cs
- ExportException.cs
- MediaTimeline.cs
- GeneralTransform3D.cs
- DocumentViewer.cs
- SharedUtils.cs
- EncryptedPackageFilter.cs
- NestPullup.cs
- NavigationProperty.cs
- PageContentCollection.cs
- unitconverter.cs
- CodeGenerationManager.cs
- BitmapSizeOptions.cs
- Encoder.cs
- MobileRedirect.cs
- ProfileGroupSettings.cs
- XmlDictionaryReaderQuotas.cs
- CharacterHit.cs
- ServiceNameCollection.cs
- XmlAttributes.cs
- DocumentViewer.cs
- EncryptedKey.cs
- TextParentUndoUnit.cs
- ToolStripContainer.cs
- ControlPropertyNameConverter.cs
- SemaphoreSecurity.cs
- PaintValueEventArgs.cs
- NestedContainer.cs
- SoapProtocolImporter.cs
- SizeAnimationUsingKeyFrames.cs
- ParserContext.cs
- ColorDialog.cs
- EFColumnProvider.cs
- MeshGeometry3D.cs
- CollectionsUtil.cs
- OleDbConnectionFactory.cs
- SqlXmlStorage.cs
- connectionpool.cs
- FontStyle.cs
- DecoderNLS.cs
- KeyEvent.cs
- QueryHandler.cs
- Convert.cs
- DataContext.cs
- SortedList.cs
- LinqDataSourceSelectEventArgs.cs
- ModifierKeysConverter.cs
- CodeMemberProperty.cs
- DbProviderFactories.cs
- WebEventCodes.cs
- DomainConstraint.cs
- SqlCacheDependencyDatabaseCollection.cs
- WindowsListViewItemCheckBox.cs
- MessageOperationFormatter.cs
- BackStopAuthenticationModule.cs
- StrokeCollection.cs
- Error.cs
- UserMapPath.cs
- DataGridPreparingCellForEditEventArgs.cs
- WebSysDefaultValueAttribute.cs
- KeyGestureValueSerializer.cs
- AuthenticationModulesSection.cs
- Timer.cs
- ToolStripItemImageRenderEventArgs.cs
- ControlCollection.cs
- BufferedGenericXmlSecurityToken.cs
- RadialGradientBrush.cs
- CustomCategoryAttribute.cs
- StyleXamlParser.cs
- HttpPostedFile.cs
- DataGridPageChangedEventArgs.cs
- While.cs
- IPCCacheManager.cs
- RoutedCommand.cs
- GridViewDeleteEventArgs.cs
- LongValidator.cs
- CacheAxisQuery.cs
- SchemaImporterExtension.cs
- X509Utils.cs
- IndentedWriter.cs
- TextStore.cs
- ButtonBaseAdapter.cs
- TextChangedEventArgs.cs
- EventSetter.cs
- DictionaryEntry.cs
- WindowsImpersonationContext.cs
- ToolStripDesignerUtils.cs