Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- QueryConverter.cs
- CodePropertyReferenceExpression.cs
- AutomationElementCollection.cs
- ToolStripControlHost.cs
- SmtpFailedRecipientsException.cs
- ColorInterpolationModeValidation.cs
- BitmapEffectDrawingContent.cs
- EdmValidator.cs
- Size.cs
- AnnotationHelper.cs
- TreeView.cs
- BlurEffect.cs
- Point3DCollectionValueSerializer.cs
- PrintPageEvent.cs
- HtmlEncodedRawTextWriter.cs
- PropertyMetadata.cs
- ToRequest.cs
- CommandField.cs
- DuplicateWaitObjectException.cs
- MSAAEventDispatcher.cs
- Polyline.cs
- QueryContinueDragEventArgs.cs
- TripleDES.cs
- SpecialNameAttribute.cs
- ImageSource.cs
- RSAOAEPKeyExchangeFormatter.cs
- WebPartHeaderCloseVerb.cs
- FontWeightConverter.cs
- sqlcontext.cs
- ParallelQuery.cs
- WsatServiceCertificate.cs
- GridViewAutomationPeer.cs
- InvokePattern.cs
- Cloud.cs
- XamlTreeBuilder.cs
- XmlSchemaNotation.cs
- XmlSchemaSimpleContentRestriction.cs
- WindowsRebar.cs
- ForeignKeyConstraint.cs
- MultipartContentParser.cs
- WsiProfilesElement.cs
- DataServiceException.cs
- SqlClientWrapperSmiStream.cs
- ThousandthOfEmRealDoubles.cs
- DoubleLink.cs
- ContentOnlyMessage.cs
- GlyphRun.cs
- ToolBarButtonClickEvent.cs
- FileDialog_Vista_Interop.cs
- XPathMessageFilter.cs
- XmlSignatureProperties.cs
- Brush.cs
- SafeNativeMethodsMilCoreApi.cs
- CaseInsensitiveComparer.cs
- ToolCreatedEventArgs.cs
- WebControlAdapter.cs
- SimpleHandlerBuildProvider.cs
- ButtonStandardAdapter.cs
- InstanceDescriptor.cs
- RequestResizeEvent.cs
- UnconditionalPolicy.cs
- GB18030Encoding.cs
- ConnectionOrientedTransportManager.cs
- Convert.cs
- VerticalAlignConverter.cs
- PageThemeBuildProvider.cs
- DataGridRow.cs
- GridViewPageEventArgs.cs
- OutputWindow.cs
- ViewCellRelation.cs
- SQLBinaryStorage.cs
- ImpersonateTokenRef.cs
- Metafile.cs
- BamlRecords.cs
- StorageEntityTypeMapping.cs
- SimpleRecyclingCache.cs
- ExceptionHelpers.cs
- DataGridViewCellParsingEventArgs.cs
- ComboBoxItem.cs
- UseLicense.cs
- VariableExpressionConverter.cs
- StrongNameUtility.cs
- TreeNodeBindingCollection.cs
- IndexerNameAttribute.cs
- Canvas.cs
- ExpandSegmentCollection.cs
- Error.cs
- TreeNodeBindingCollection.cs
- XmlSerializerAssemblyAttribute.cs
- ResourceManagerWrapper.cs
- AssertUtility.cs
- PeerName.cs
- BooleanFunctions.cs
- DocumentAutomationPeer.cs
- MimeBasePart.cs
- TimerEventSubscription.cs
- PatternMatchRules.cs
- EdmComplexTypeAttribute.cs
- RegexCapture.cs
- PeerHelpers.cs