Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / DataEntity / System / Data / EntityModel / SchemaObjectModel / FilteredSchemaElementLookUpTable.cs / 3 / 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
- TreeNodeBinding.cs
- SharedUtils.cs
- OutKeywords.cs
- DataSourceControlBuilder.cs
- GraphicsState.cs
- ImageConverter.cs
- OletxEnlistment.cs
- AnimationStorage.cs
- UIElement.cs
- CalendarDay.cs
- ConvertEvent.cs
- HelpInfo.cs
- VisualBasicExpressionConverter.cs
- FileDialog.cs
- AutomationPatternInfo.cs
- AuthenticationSection.cs
- ListenDesigner.cs
- XmlDictionaryString.cs
- TextHintingModeValidation.cs
- __Error.cs
- DataGridTextBox.cs
- InputReferenceExpression.cs
- _WebProxyDataBuilder.cs
- Behavior.cs
- CodeAccessSecurityEngine.cs
- ClientSettingsSection.cs
- RemoteX509AsymmetricSecurityKey.cs
- ConfigXmlComment.cs
- DataGridViewButtonColumn.cs
- UITypeEditors.cs
- ResourcesBuildProvider.cs
- WebPartMovingEventArgs.cs
- WorkflowMessageEventHandler.cs
- UnsafeNativeMethods.cs
- metadatamappinghashervisitor.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- SqlClientPermission.cs
- ProfileSection.cs
- WorkflowWebHostingModule.cs
- MonthCalendarDesigner.cs
- PEFileEvidenceFactory.cs
- DisplayMemberTemplateSelector.cs
- DataColumnPropertyDescriptor.cs
- BitmapPalette.cs
- FormViewCommandEventArgs.cs
- BuildDependencySet.cs
- SolidColorBrush.cs
- EmptyEnumerator.cs
- NavigateEvent.cs
- MimeAnyImporter.cs
- FeatureSupport.cs
- SoundPlayerAction.cs
- NavigationFailedEventArgs.cs
- File.cs
- CngProperty.cs
- FormsAuthenticationUserCollection.cs
- Process.cs
- BevelBitmapEffect.cs
- ToolboxItem.cs
- EncodingStreamWrapper.cs
- remotingproxy.cs
- ServiceRoute.cs
- EventLogger.cs
- DiscoveryReferences.cs
- DbReferenceCollection.cs
- DataGridViewSelectedRowCollection.cs
- HttpServerUtilityWrapper.cs
- RedirectionProxy.cs
- MarkupExtensionParser.cs
- unitconverter.cs
- CapiHashAlgorithm.cs
- RetriableClipboard.cs
- ObjectStateFormatter.cs
- SqlCharStream.cs
- BrowserCapabilitiesCodeGenerator.cs
- ConfigurationSchemaErrors.cs
- DataGridViewSelectedCellCollection.cs
- RowType.cs
- ErrorEventArgs.cs
- RowUpdatingEventArgs.cs
- SoapMessage.cs
- XmlHelper.cs
- SafeEventHandle.cs
- ConstraintStruct.cs
- Literal.cs
- CodeGenerator.cs
- ResourceDictionary.cs
- TextFormatterHost.cs
- CodeMemberMethod.cs
- SchemaMerger.cs
- ChangeInterceptorAttribute.cs
- NetCodeGroup.cs
- ConfigurationCollectionAttribute.cs
- LogExtentCollection.cs
- ObjectSpanRewriter.cs
- Trace.cs
- XmlCharType.cs
- SettingsPropertyCollection.cs
- RunWorkerCompletedEventArgs.cs
- FileIOPermission.cs