Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / ndp / fx / src / DataEntity / System / Data / Metadata / Edm / safelink.cs / 1 / safelink.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....], [....] //---------------------------------------------------------------------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. //---------------------------------------------------------------------- // // Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....], [....] //---------------------------------------------------------------------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
- GC.cs
- OperationResponse.cs
- MultiView.cs
- Margins.cs
- AuthenticationManager.cs
- Signature.cs
- ArrayElementGridEntry.cs
- CodeSubDirectoriesCollection.cs
- HtmlShim.cs
- TrustManagerMoreInformation.cs
- WebPageTraceListener.cs
- GeneralTransform3DTo2DTo3D.cs
- MetadataFile.cs
- PreviewControlDesigner.cs
- JoinCqlBlock.cs
- DropShadowEffect.cs
- RectangleHotSpot.cs
- MergeEnumerator.cs
- ExpressionsCollectionEditor.cs
- NTAccount.cs
- ELinqQueryState.cs
- PenThreadWorker.cs
- SafeRightsManagementQueryHandle.cs
- DbParameterHelper.cs
- RewritingProcessor.cs
- XMLSchema.cs
- PreviewPrintController.cs
- ClientConfigPaths.cs
- SqlDependencyUtils.cs
- TextServicesContext.cs
- _ScatterGatherBuffers.cs
- SqlCrossApplyToCrossJoin.cs
- StorageAssociationTypeMapping.cs
- SettingsPropertyCollection.cs
- Literal.cs
- IntSecurity.cs
- SettingsSavedEventArgs.cs
- BidOverLoads.cs
- FixedSOMImage.cs
- WmlControlAdapter.cs
- Help.cs
- SamlAction.cs
- DiagnosticsConfigurationHandler.cs
- DBAsyncResult.cs
- XmlSchemaFacet.cs
- MetadataWorkspace.cs
- ButtonBaseAdapter.cs
- Rfc4050KeyFormatter.cs
- CompleteWizardStep.cs
- COSERVERINFO.cs
- RegexCharClass.cs
- MethodToken.cs
- XmlNamespaceMapping.cs
- MethodMessage.cs
- SiteOfOriginContainer.cs
- FixedTextBuilder.cs
- AccessorTable.cs
- TextEditorCopyPaste.cs
- ComponentResourceKeyConverter.cs
- SyndicationCategory.cs
- ParallelTimeline.cs
- ToolStripControlHost.cs
- UnmanagedMarshal.cs
- ZipQueryOperator.cs
- StreamSecurityUpgradeInitiatorAsyncResult.cs
- HttpSysSettings.cs
- WebPartConnectionsCloseVerb.cs
- StrongTypingException.cs
- SharedStatics.cs
- InternalPermissions.cs
- Synchronization.cs
- GridViewItemAutomationPeer.cs
- SmiMetaDataProperty.cs
- SelectionHighlightInfo.cs
- CodeSubDirectoriesCollection.cs
- Geometry.cs
- Vector3DIndependentAnimationStorage.cs
- LambdaCompiler.Expressions.cs
- FormViewRow.cs
- ConnectionPoint.cs
- TagPrefixAttribute.cs
- Root.cs
- WorkflowInstanceExtensionManager.cs
- VisualBrush.cs
- StaticExtension.cs
- BufferedStream.cs
- ObjectStateFormatter.cs
- WinEventTracker.cs
- DBParameter.cs
- SystemIcmpV4Statistics.cs
- RecordManager.cs
- SessionSwitchEventArgs.cs
- OdbcException.cs
- ViewPort3D.cs
- Calendar.cs
- GraphicsState.cs
- VectorConverter.cs
- WindowHelperService.cs
- ColorTranslator.cs
- Type.cs