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
- ExtendedPropertyCollection.cs
- UmAlQuraCalendar.cs
- SessionStateModule.cs
- XmlNode.cs
- FontResourceCache.cs
- SamlSecurityTokenAuthenticator.cs
- TraceData.cs
- DPCustomTypeDescriptor.cs
- UnionExpr.cs
- TreeNode.cs
- BindingCompleteEventArgs.cs
- ISCIIEncoding.cs
- FileNotFoundException.cs
- XmlSchemaChoice.cs
- SqlTopReducer.cs
- TimeIntervalCollection.cs
- OdbcCommand.cs
- TextView.cs
- Color.cs
- BrushConverter.cs
- HtmlImage.cs
- QueryPageSettingsEventArgs.cs
- InvokeMethodDesigner.xaml.cs
- EntityContainerEntitySetDefiningQuery.cs
- DefaultHttpHandler.cs
- MergeExecutor.cs
- RoleService.cs
- ComponentChangingEvent.cs
- SecurityPolicySection.cs
- TemplateControlParser.cs
- AspCompat.cs
- StringValueSerializer.cs
- DependencyObjectCodeDomSerializer.cs
- UnsettableComboBox.cs
- NotifyInputEventArgs.cs
- RepeaterItemCollection.cs
- SystemPens.cs
- dataobject.cs
- PropertyItemInternal.cs
- Int32KeyFrameCollection.cs
- AsymmetricKeyExchangeFormatter.cs
- DrawingAttributes.cs
- DPTypeDescriptorContext.cs
- LinkButton.cs
- SqlBuilder.cs
- MetadataSet.cs
- GlyphRunDrawing.cs
- Timer.cs
- ReferenceSchema.cs
- WindowsFont.cs
- PeerResolverElement.cs
- RepeaterCommandEventArgs.cs
- XmlStreamStore.cs
- DocumentViewerAutomationPeer.cs
- UnmanagedHandle.cs
- AvTraceDetails.cs
- DocumentPageTextView.cs
- _NativeSSPI.cs
- SafeHandles.cs
- HttpModuleAction.cs
- TraceFilter.cs
- ArithmeticException.cs
- SchemaDeclBase.cs
- RectKeyFrameCollection.cs
- Decorator.cs
- UserControlBuildProvider.cs
- TaskFileService.cs
- Metafile.cs
- ClientBuildManager.cs
- PropertyManager.cs
- IHttpResponseInternal.cs
- LabelAutomationPeer.cs
- TypeConverterHelper.cs
- QueryResult.cs
- InstallerTypeAttribute.cs
- DataGridViewRowPrePaintEventArgs.cs
- QueryParameter.cs
- JoinTreeSlot.cs
- PrePostDescendentsWalker.cs
- EventData.cs
- ProgressBarAutomationPeer.cs
- TableRowGroup.cs
- ColumnClickEvent.cs
- ArrayElementGridEntry.cs
- XmlChoiceIdentifierAttribute.cs
- OlePropertyStructs.cs
- OdbcReferenceCollection.cs
- ExtentCqlBlock.cs
- SpellerHighlightLayer.cs
- CookieHandler.cs
- Vector3D.cs
- CursorConverter.cs
- LocalTransaction.cs
- ScriptDescriptor.cs
- PaperSize.cs
- IItemContainerGenerator.cs
- ResolveMatchesMessageCD1.cs
- ExtensionElement.cs
- MatrixTransform3D.cs
- StructureChangedEventArgs.cs