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
- CodeDefaultValueExpression.cs
- DbProviderSpecificTypePropertyAttribute.cs
- Section.cs
- SmtpFailedRecipientException.cs
- RadioButtonFlatAdapter.cs
- PathFigureCollectionValueSerializer.cs
- NetworkAddressChange.cs
- RelationshipEntry.cs
- FormViewCommandEventArgs.cs
- ThousandthOfEmRealDoubles.cs
- ClosableStream.cs
- SqlProcedureAttribute.cs
- XPathNodePointer.cs
- ByteBufferPool.cs
- NamespaceQuery.cs
- ToolboxItemFilterAttribute.cs
- AssemblyCache.cs
- XmlSerializationReader.cs
- AssemblyNameProxy.cs
- PopOutPanel.cs
- DateTimeFormatInfoScanner.cs
- ListViewItemSelectionChangedEvent.cs
- FormatVersion.cs
- ConfigXmlText.cs
- SmtpFailedRecipientException.cs
- PointHitTestParameters.cs
- ChangeDirector.cs
- TypeDelegator.cs
- ActivityUtilities.cs
- DataSourceControlBuilder.cs
- CodeCatchClause.cs
- XmlSchemaAppInfo.cs
- GridErrorDlg.cs
- WebPartsPersonalization.cs
- XamlWriter.cs
- SoapElementAttribute.cs
- ConfigXmlCDataSection.cs
- CaseInsensitiveHashCodeProvider.cs
- Condition.cs
- _OSSOCK.cs
- FieldAccessException.cs
- KeyTime.cs
- DataAccessor.cs
- Wildcard.cs
- EpmContentSerializer.cs
- CodeIndexerExpression.cs
- SoapFormatExtensions.cs
- ToolStripItemRenderEventArgs.cs
- TreeViewAutomationPeer.cs
- SelectionEditor.cs
- StrokeDescriptor.cs
- StylusShape.cs
- ObjectListCommand.cs
- AutomationEvent.cs
- ProcessHostConfigUtils.cs
- DataControlLinkButton.cs
- PropertyEmitter.cs
- Timer.cs
- SQLGuidStorage.cs
- RequestCacheValidator.cs
- WebPartCollection.cs
- CDSCollectionETWBCLProvider.cs
- ListViewDataItem.cs
- DefaultValueConverter.cs
- ObjectComplexPropertyMapping.cs
- Panel.cs
- ParentQuery.cs
- ByteAnimationUsingKeyFrames.cs
- FileInfo.cs
- NodeLabelEditEvent.cs
- HitTestDrawingContextWalker.cs
- RuleEngine.cs
- CodeAttributeArgumentCollection.cs
- TextBoxRenderer.cs
- Splitter.cs
- Rotation3DAnimationBase.cs
- DeadLetterQueue.cs
- Font.cs
- MulticastOption.cs
- LinqDataSourceValidationException.cs
- StackBuilderSink.cs
- SendActivity.cs
- SubMenuStyle.cs
- WebPartEditorApplyVerb.cs
- CheckBoxAutomationPeer.cs
- OdbcConnectionPoolProviderInfo.cs
- MessageRpc.cs
- InfoCardTrace.cs
- SiteMapDesignerDataSourceView.cs
- BitFlagsGenerator.cs
- RadioButtonList.cs
- BamlBinaryWriter.cs
- XmlCharType.cs
- XmlWriterTraceListener.cs
- Utils.cs
- RouteValueExpressionBuilder.cs
- IdlingCommunicationPool.cs
- FillRuleValidation.cs
- TextEditorContextMenu.cs
- PageThemeParser.cs