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
- Zone.cs
- DetailsViewPageEventArgs.cs
- SystemIPGlobalStatistics.cs
- TemplateControl.cs
- NativeActivityContext.cs
- StrokeCollection2.cs
- COM2TypeInfoProcessor.cs
- SelectingProviderEventArgs.cs
- TemplatedWizardStep.cs
- SmtpTransport.cs
- LogicalCallContext.cs
- TemplateManager.cs
- DynamicValueConverter.cs
- CommandValueSerializer.cs
- KeyGestureConverter.cs
- NativeMethods.cs
- MetaData.cs
- FormViewUpdateEventArgs.cs
- SubpageParaClient.cs
- Documentation.cs
- JsonServiceDocumentSerializer.cs
- OdbcConnectionFactory.cs
- XmlTypeMapping.cs
- ModuleConfigurationInfo.cs
- PkcsMisc.cs
- SelectionListDesigner.cs
- FunctionImportElement.cs
- MediaPlayer.cs
- DuplicateWaitObjectException.cs
- RemotingConfigParser.cs
- TextTreePropertyUndoUnit.cs
- ImpersonationContext.cs
- Adorner.cs
- CodeThrowExceptionStatement.cs
- TabControlToolboxItem.cs
- RangeValueProviderWrapper.cs
- ClientType.cs
- MILUtilities.cs
- RecognizedAudio.cs
- ChooseAction.cs
- ManagementScope.cs
- PenLineJoinValidation.cs
- TextFormatter.cs
- RadioButton.cs
- Model3D.cs
- MimeMultiPart.cs
- DataControlHelper.cs
- SliderAutomationPeer.cs
- SerializationSectionGroup.cs
- ColorDialog.cs
- SchemaNames.cs
- SourceFileBuildProvider.cs
- HyperLinkColumn.cs
- WebZone.cs
- RestHandlerFactory.cs
- DetailsViewCommandEventArgs.cs
- ApplicationSecurityManager.cs
- XmlDocument.cs
- XslAstAnalyzer.cs
- TypeReference.cs
- FlowThrottle.cs
- TypeSource.cs
- COMException.cs
- Buffer.cs
- PartitionResolver.cs
- CompensationHandlingFilter.cs
- TypeUnloadedException.cs
- ByteRangeDownloader.cs
- FilterElement.cs
- DomainConstraint.cs
- WindowsStatusBar.cs
- DiagnosticsConfiguration.cs
- Triplet.cs
- HtmlInputControl.cs
- TextEditor.cs
- StatusBar.cs
- Process.cs
- infer.cs
- LinqMaximalSubtreeNominator.cs
- SqlConnectionStringBuilder.cs
- DataGridTableStyleMappingNameEditor.cs
- xmlsaver.cs
- ClientSideProviderDescription.cs
- TdsParser.cs
- ExpressionNormalizer.cs
- ValueHandle.cs
- XmlSchemaDocumentation.cs
- unsafenativemethodstextservices.cs
- EntityViewContainer.cs
- InertiaTranslationBehavior.cs
- SrgsSemanticInterpretationTag.cs
- DataGridViewCellEventArgs.cs
- TableProviderWrapper.cs
- StylusButtonEventArgs.cs
- OracleBFile.cs
- TableParaClient.cs
- BoundPropertyEntry.cs
- DataGridViewRowPostPaintEventArgs.cs
- UpdatePanel.cs
- StringDictionary.cs