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
- WebSysDescriptionAttribute.cs
- RightsManagementErrorHandler.cs
- UmAlQuraCalendar.cs
- ToolBar.cs
- MethodToken.cs
- StrongNamePublicKeyBlob.cs
- OleDbErrorCollection.cs
- LinqDataView.cs
- StylusCollection.cs
- RequestTimeoutManager.cs
- FunctionMappingTranslator.cs
- ModuleElement.cs
- XmlElementElementCollection.cs
- Label.cs
- ResourceProperty.cs
- WindowsListViewScroll.cs
- WebRequest.cs
- CompoundFileReference.cs
- DataListComponentEditor.cs
- Formatter.cs
- ThemeConfigurationDialog.cs
- CodeTypeReference.cs
- CompositeFontFamily.cs
- ListDesigner.cs
- FaultPropagationRecord.cs
- BinaryCommonClasses.cs
- ExpandCollapseProviderWrapper.cs
- UpDownEvent.cs
- CorruptingExceptionCommon.cs
- SelectingProviderEventArgs.cs
- EdmToObjectNamespaceMap.cs
- ReaderWriterLockWrapper.cs
- HwndSourceParameters.cs
- Debug.cs
- MethodBuilder.cs
- SqlConnectionHelper.cs
- PageCodeDomTreeGenerator.cs
- NetworkInformationException.cs
- ToolStripScrollButton.cs
- DataGridViewTopLeftHeaderCell.cs
- FlowPanelDesigner.cs
- ToolStripSeparator.cs
- ValidatingReaderNodeData.cs
- ContextStack.cs
- TextRunProperties.cs
- Point4DConverter.cs
- TimeSpanMinutesConverter.cs
- ExpressionBuilder.cs
- XmlCharacterData.cs
- panel.cs
- GeometryGroup.cs
- ScopeElementCollection.cs
- CryptographicAttribute.cs
- FileNotFoundException.cs
- Camera.cs
- LogicalTreeHelper.cs
- DataKey.cs
- StateMachine.cs
- PropertyFilterAttribute.cs
- DropDownButton.cs
- Style.cs
- ChameleonKey.cs
- WebPartManagerInternals.cs
- DataViewListener.cs
- XmlTypeAttribute.cs
- Vector.cs
- CriticalExceptions.cs
- CompilationUtil.cs
- AssociationTypeEmitter.cs
- XhtmlMobileTextWriter.cs
- XmlElementAttribute.cs
- CreateUserErrorEventArgs.cs
- Point3DAnimationUsingKeyFrames.cs
- RootProfilePropertySettingsCollection.cs
- PropertyManager.cs
- WebConfigurationFileMap.cs
- LayoutUtils.cs
- Evidence.cs
- Clause.cs
- GroupItemAutomationPeer.cs
- SourceChangedEventArgs.cs
- RootBrowserWindowProxy.cs
- WebPartManagerInternals.cs
- LinkButton.cs
- PseudoWebRequest.cs
- _StreamFramer.cs
- SqlCacheDependencySection.cs
- BindingManagerDataErrorEventArgs.cs
- AutoScrollHelper.cs
- AddressingVersion.cs
- Matrix3DValueSerializer.cs
- OleDbReferenceCollection.cs
- XmlRawWriter.cs
- WebScriptServiceHost.cs
- Evaluator.cs
- ProtocolsConfigurationHandler.cs
- PageBuildProvider.cs
- OleDbParameterCollection.cs
- HttpListenerResponse.cs
- SchemaImporterExtensionElementCollection.cs