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
- DebugView.cs
- EditorZoneAutoFormat.cs
- StickyNote.cs
- ErasingStroke.cs
- TemplateModeChangedEventArgs.cs
- MTConfigUtil.cs
- DictionaryMarkupSerializer.cs
- VectorCollectionValueSerializer.cs
- RoleManagerEventArgs.cs
- ProtocolViolationException.cs
- MarshalByRefObject.cs
- HttpDebugHandler.cs
- TextParagraphView.cs
- RegexFCD.cs
- unsafenativemethodsother.cs
- RIPEMD160.cs
- X509Extension.cs
- X509Certificate2.cs
- PropertyNames.cs
- MarshalByRefObject.cs
- RuntimeConfig.cs
- Console.cs
- StructuredTypeEmitter.cs
- DataSourceProvider.cs
- AppDomainManager.cs
- HtmlElementCollection.cs
- figurelength.cs
- MatrixCamera.cs
- CalendarItem.cs
- ComplexTypeEmitter.cs
- ExecutionTracker.cs
- RectangleGeometry.cs
- DataControlPagerLinkButton.cs
- ClonableStack.cs
- XmlAutoDetectWriter.cs
- XmlArrayItemAttributes.cs
- HwndAppCommandInputProvider.cs
- HitTestResult.cs
- RegexTypeEditor.cs
- MimeReflector.cs
- basevalidator.cs
- StrokeCollection2.cs
- WsdlExporter.cs
- BasicViewGenerator.cs
- OdbcFactory.cs
- Timer.cs
- SerializationBinder.cs
- listitem.cs
- CultureSpecificStringDictionary.cs
- Vector3D.cs
- SizeAnimationBase.cs
- MenuItem.cs
- XPathAncestorQuery.cs
- StylusCaptureWithinProperty.cs
- ImageListUtils.cs
- Transactions.cs
- GeneralTransform.cs
- OperationBehaviorAttribute.cs
- _SpnDictionary.cs
- AppDomainProtocolHandler.cs
- CheckoutException.cs
- Rijndael.cs
- BufferAllocator.cs
- PropertyEntry.cs
- ForeignKeyConstraint.cs
- RequestQueue.cs
- CalendarDateRangeChangingEventArgs.cs
- ViewStateException.cs
- ADMembershipProvider.cs
- PrinterUnitConvert.cs
- SequenceDesigner.xaml.cs
- SupportsEventValidationAttribute.cs
- XsdDataContractExporter.cs
- RegexCaptureCollection.cs
- FilterableAttribute.cs
- FrugalList.cs
- TranslateTransform3D.cs
- RootAction.cs
- Context.cs
- EntityObject.cs
- SessionStateSection.cs
- Rotation3D.cs
- PasswordValidationException.cs
- RegexStringValidatorAttribute.cs
- QilStrConcatenator.cs
- APCustomTypeDescriptor.cs
- CachedTypeface.cs
- DateTimeOffsetStorage.cs
- PackagePartCollection.cs
- XmlValidatingReaderImpl.cs
- SystemThemeKey.cs
- AnonymousIdentificationSection.cs
- ReceiveMessageContent.cs
- RadioButton.cs
- FontStyleConverter.cs
- CheckBoxField.cs
- ErrorHandler.cs
- WebGetAttribute.cs
- DataTemplateSelector.cs
- VirtualPathUtility.cs