Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Metadata / Edm / safelink.cs / 1305376 / safelink.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //---------------------------------------------------------------------using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Diagnostics; namespace System.Data.Metadata.Edm { internal class SafeLinkwhere TParent : class { private TParent _value; public TParent Value { get { return _value; } } internal static IEnumerable BindChildren (TParent parent, Func > getLink, IEnumerable children) { foreach (TChild child in children) { BindChild(parent, getLink, child); } return children; } internal static TChild BindChild (TParent parent, Func > getLink, TChild child) { SafeLink link = getLink(child); Debug.Assert(link._value == null || link._value == parent, "don't try to hook up the same child to a different parent"); // this is the good stuff.. // only this method can actually make the link since _value is a private link._value = parent; return child; } } } // 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
- StickyNoteAnnotations.cs
- TextModifierScope.cs
- ExtendedPropertyDescriptor.cs
- XmlSchemaFacet.cs
- Transform3DGroup.cs
- CodeRegionDirective.cs
- ImageField.cs
- GridViewSelectEventArgs.cs
- AsyncOperation.cs
- DbDataRecord.cs
- PrintDialogDesigner.cs
- FunctionQuery.cs
- SqlDependency.cs
- ClientConfigurationSystem.cs
- DataFormat.cs
- View.cs
- MutableAssemblyCacheEntry.cs
- ScrollableControl.cs
- CodeMethodReturnStatement.cs
- listviewsubitemcollectioneditor.cs
- PointCollection.cs
- SqlNodeTypeOperators.cs
- CommandField.cs
- ByteStorage.cs
- SolidColorBrush.cs
- WebPartConnectionsCloseVerb.cs
- URLAttribute.cs
- FormatterServicesNoSerializableCheck.cs
- PresentationAppDomainManager.cs
- FileDataSource.cs
- EasingQuaternionKeyFrame.cs
- XPathAncestorQuery.cs
- ResourceAssociationSetEnd.cs
- Inline.cs
- FileDataSourceCache.cs
- CustomErrorsSectionWrapper.cs
- TagMapInfo.cs
- ErrorStyle.cs
- DynamicMethod.cs
- AppDomainInstanceProvider.cs
- AnnotationStore.cs
- ObjectKeyFrameCollection.cs
- PreservationFileReader.cs
- ResourceDescriptionAttribute.cs
- ToolBar.cs
- UiaCoreApi.cs
- PageCache.cs
- SqlFactory.cs
- VirtualPathUtility.cs
- PropertyChangedEventManager.cs
- CommunicationException.cs
- TimeBoundedCache.cs
- StyleXamlParser.cs
- PermissionToken.cs
- GraphicsPath.cs
- XamlTemplateSerializer.cs
- WindowsTooltip.cs
- ObjectDataSourceFilteringEventArgs.cs
- IncrementalHitTester.cs
- MetadataExchangeBindings.cs
- Hashtable.cs
- UnhandledExceptionEventArgs.cs
- SingleSelectRootGridEntry.cs
- AbandonedMutexException.cs
- BufferBuilder.cs
- XmlSchemaSimpleTypeList.cs
- PkcsUtils.cs
- ChtmlCommandAdapter.cs
- SoapServerMessage.cs
- Resources.Designer.cs
- SplineKeyFrames.cs
- RtType.cs
- AutoScrollHelper.cs
- CustomAttributeBuilder.cs
- ToolStripMenuItemDesigner.cs
- UpdateCommand.cs
- validation.cs
- BoundField.cs
- EntityClientCacheEntry.cs
- DtdParser.cs
- CompiledRegexRunnerFactory.cs
- BamlMapTable.cs
- OdbcError.cs
- RoleGroup.cs
- WebScriptServiceHostFactory.cs
- ListViewItem.cs
- ConfigXmlText.cs
- MailHeaderInfo.cs
- FlowLayout.cs
- SqlBuilder.cs
- SymbolEqualComparer.cs
- HtmlImage.cs
- BulletChrome.cs
- TextViewBase.cs
- HttpBrowserCapabilitiesWrapper.cs
- ContextMenuAutomationPeer.cs
- TextRange.cs
- ClassHandlersStore.cs
- ProcessModelSection.cs
- RequestQueue.cs