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
- CfgRule.cs
- RawMouseInputReport.cs
- MembershipUser.cs
- NavigatingCancelEventArgs.cs
- XmlBinaryReader.cs
- HitTestParameters3D.cs
- ResXResourceSet.cs
- Message.cs
- XmlArrayItemAttributes.cs
- ReadOnlyDataSourceView.cs
- XLinq.cs
- AssemblyResourceLoader.cs
- LambdaCompiler.Expressions.cs
- Literal.cs
- DataGridViewCellLinkedList.cs
- HttpResponseInternalWrapper.cs
- VirtualDirectoryMapping.cs
- Subset.cs
- DataGridCommandEventArgs.cs
- DesignerAutoFormatStyle.cs
- TextCompositionManager.cs
- ZoneButton.cs
- WindowsTreeView.cs
- AuthenticationConfig.cs
- ClientSettingsStore.cs
- MultiDataTrigger.cs
- Size.cs
- _FtpControlStream.cs
- ManagedFilter.cs
- BitmapInitialize.cs
- HttpWebRequest.cs
- ArgumentNullException.cs
- HttpHeaderCollection.cs
- ResourcePermissionBaseEntry.cs
- BitmapEffectGeneralTransform.cs
- ThemeDirectoryCompiler.cs
- LassoSelectionBehavior.cs
- LinkButton.cs
- MessageQueueTransaction.cs
- ContentFilePart.cs
- Input.cs
- GeometryDrawing.cs
- MessageRpc.cs
- DBAsyncResult.cs
- TraceContextRecord.cs
- ButtonStandardAdapter.cs
- ColorAnimation.cs
- MouseGestureValueSerializer.cs
- DataGridTextBoxColumn.cs
- ipaddressinformationcollection.cs
- Operand.cs
- FuncTypeConverter.cs
- TdsRecordBufferSetter.cs
- ReflectEventDescriptor.cs
- ServiceRoute.cs
- SiteMapNodeItem.cs
- FileDialog.cs
- CultureInfo.cs
- OracleTimeSpan.cs
- StandardCommands.cs
- Shared.cs
- BindingContext.cs
- CompilationRelaxations.cs
- ClientFormsIdentity.cs
- ZipIOExtraFieldZip64Element.cs
- InputLanguageEventArgs.cs
- FastPropertyAccessor.cs
- PropertyDescriptorGridEntry.cs
- DataGridViewCellCancelEventArgs.cs
- StringAnimationBase.cs
- OdbcConnectionHandle.cs
- DefaultCompensation.cs
- WebPartConnectionsEventArgs.cs
- HttpListenerException.cs
- SafeNativeMethods.cs
- Vector3D.cs
- safemediahandle.cs
- ParameterCollection.cs
- LiteralTextParser.cs
- WebPartEditorOkVerb.cs
- CommonRemoteMemoryBlock.cs
- SerialReceived.cs
- RedistVersionInfo.cs
- WriteFileContext.cs
- GridEntryCollection.cs
- Cursors.cs
- DefaultPrintController.cs
- TraversalRequest.cs
- DrawingCollection.cs
- TableStyle.cs
- diagnosticsswitches.cs
- XmlWrappingReader.cs
- GlyphTypeface.cs
- ApplicationContext.cs
- ProjectionAnalyzer.cs
- HyperLinkColumn.cs
- DateTimeStorage.cs
- ZipIOFileItemStream.cs
- ChildDocumentBlock.cs
- BatchParser.cs