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
- _emptywebproxy.cs
- TransportReplyChannelAcceptor.cs
- DesignerVerbCollection.cs
- CompilerWrapper.cs
- DataBinder.cs
- CustomAssemblyResolver.cs
- ThaiBuddhistCalendar.cs
- DBPropSet.cs
- XPathSelfQuery.cs
- ExpandableObjectConverter.cs
- activationcontext.cs
- FormsAuthenticationConfiguration.cs
- OperationInfoBase.cs
- MasterPageParser.cs
- PropertyToken.cs
- FusionWrap.cs
- PrintDialog.cs
- userdatakeys.cs
- SigningProgress.cs
- ConnectionInterfaceCollection.cs
- Optimizer.cs
- ImplicitInputBrush.cs
- WorkflowInstanceExtensionProvider.cs
- TreeViewHitTestInfo.cs
- QueryStringHandler.cs
- OneOfTypeConst.cs
- AuthorizationSection.cs
- DependencyProperty.cs
- ServerValidateEventArgs.cs
- HMAC.cs
- HashLookup.cs
- QueryExpr.cs
- SecurityTokenRequirement.cs
- JapaneseCalendar.cs
- ChameleonKey.cs
- DbParameterHelper.cs
- DataColumnMapping.cs
- RijndaelManagedTransform.cs
- ParameterReplacerVisitor.cs
- ProjectionCamera.cs
- PaginationProgressEventArgs.cs
- IgnoreDataMemberAttribute.cs
- DrawListViewSubItemEventArgs.cs
- FullTextState.cs
- Permission.cs
- WebReference.cs
- HttpRequestTraceRecord.cs
- AtomServiceDocumentSerializer.cs
- ConfigDefinitionUpdates.cs
- mediaeventargs.cs
- XmlCountingReader.cs
- PopupRootAutomationPeer.cs
- WebPartZoneBase.cs
- TextServicesLoader.cs
- XmlChoiceIdentifierAttribute.cs
- DebugHandleTracker.cs
- XmlMembersMapping.cs
- ChangeBlockUndoRecord.cs
- CalendarTable.cs
- hresults.cs
- XNodeSchemaApplier.cs
- PiiTraceSource.cs
- Encoding.cs
- MergablePropertyAttribute.cs
- ConnectivityStatus.cs
- DesignerValidatorAdapter.cs
- BufferedGraphicsManager.cs
- GenericAuthenticationEventArgs.cs
- EventLogPermissionAttribute.cs
- TextViewBase.cs
- CatalogPartDesigner.cs
- WindowHideOrCloseTracker.cs
- ConnectionStringsExpressionEditor.cs
- RegisteredDisposeScript.cs
- EntityWrapper.cs
- DisposableCollectionWrapper.cs
- SpellerStatusTable.cs
- exports.cs
- WinFormsUtils.cs
- MessageLogger.cs
- EnumerableRowCollection.cs
- LookupNode.cs
- SqlStream.cs
- GlyphsSerializer.cs
- RichTextBox.cs
- PointHitTestParameters.cs
- InternalBase.cs
- EllipseGeometry.cs
- QuaternionAnimation.cs
- SpinWait.cs
- UIntPtr.cs
- PluralizationService.cs
- InfocardExtendedInformationEntry.cs
- CustomWebEventKey.cs
- FontCacheLogic.cs
- XmlQualifiedNameTest.cs
- InputProviderSite.cs
- RichTextBox.cs
- HttpMethodConstraint.cs
- SqlGenericUtil.cs