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
- GenericTypeParameterBuilder.cs
- SEHException.cs
- ListViewGroupItemCollection.cs
- StartFileNameEditor.cs
- AjaxFrameworkAssemblyAttribute.cs
- PrinterUnitConvert.cs
- GenericIdentity.cs
- ExpressionCopier.cs
- NonBatchDirectoryCompiler.cs
- SystemUnicastIPAddressInformation.cs
- ControlEvent.cs
- ColumnCollection.cs
- DnsPermission.cs
- RelationshipWrapper.cs
- OutputCache.cs
- HtmlContainerControl.cs
- HttpValueCollection.cs
- Hashtable.cs
- COM2ExtendedUITypeEditor.cs
- SystemIPGlobalProperties.cs
- EmptyStringExpandableObjectConverter.cs
- Bits.cs
- EncoderNLS.cs
- MimeMultiPart.cs
- Imaging.cs
- ListViewItem.cs
- ChameleonKey.cs
- ThemeDictionaryExtension.cs
- LOSFormatter.cs
- InternalResources.cs
- PinnedBufferMemoryStream.cs
- StyleConverter.cs
- TextRangeAdaptor.cs
- ToolboxItemAttribute.cs
- ProjectionCamera.cs
- SqlClientWrapperSmiStreamChars.cs
- ToolbarAUtomationPeer.cs
- FolderBrowserDialogDesigner.cs
- Helpers.cs
- XmlSchemaInclude.cs
- LexicalChunk.cs
- SqlClientWrapperSmiStreamChars.cs
- AuthenticationManager.cs
- ErrorActivity.cs
- WinEventQueueItem.cs
- DebugView.cs
- AssociatedControlConverter.cs
- InvalidEnumArgumentException.cs
- AmbientEnvironment.cs
- ExtenderControl.cs
- TextDecorationCollection.cs
- FloatUtil.cs
- BackoffTimeoutHelper.cs
- SerializationInfo.cs
- DiscoveryDocumentSearchPattern.cs
- TypeUtil.cs
- QueryStringParameter.cs
- SoundPlayer.cs
- SchemaContext.cs
- PersonalizationStateQuery.cs
- EventLogPermission.cs
- util.cs
- SkipQueryOptionExpression.cs
- ConfigurationHelpers.cs
- XmlSchemaProviderAttribute.cs
- NavigationProgressEventArgs.cs
- HierarchicalDataSourceConverter.cs
- Token.cs
- IisTraceWebEventProvider.cs
- IsolatedStorageSecurityState.cs
- ErrorFormatterPage.cs
- ReceiveSecurityHeaderEntry.cs
- AncillaryOps.cs
- WebPartVerbCollection.cs
- ConnectionStringsSection.cs
- PageCache.cs
- String.cs
- VectorCollectionConverter.cs
- ParserHooks.cs
- CollectionViewProxy.cs
- Timer.cs
- Task.cs
- RelationalExpressions.cs
- WebBrowserDesigner.cs
- DataGridViewLayoutData.cs
- XmlTextReader.cs
- SystemPens.cs
- XPathNavigatorReader.cs
- Accessors.cs
- UnaryNode.cs
- ConnectionConsumerAttribute.cs
- AddInController.cs
- PathParser.cs
- SqlBulkCopy.cs
- BindingElement.cs
- VectorCollectionValueSerializer.cs
- PropertyDescriptorCollection.cs
- TextElement.cs
- CharacterString.cs
- SizeFConverter.cs