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
- SamlAuthorizationDecisionClaimResource.cs
- HttpCapabilitiesSectionHandler.cs
- SafeLibraryHandle.cs
- Compiler.cs
- SafeSystemMetrics.cs
- WebPartTracker.cs
- Relationship.cs
- DefaultPrintController.cs
- ThemeDirectoryCompiler.cs
- ImageAnimator.cs
- HtmlForm.cs
- ControlEvent.cs
- NodeFunctions.cs
- UInt32Storage.cs
- ConsoleEntryPoint.cs
- RichListBox.cs
- Region.cs
- ClrProviderManifest.cs
- WpfXamlMember.cs
- EventSinkHelperWriter.cs
- RefType.cs
- WebPartVerbsEventArgs.cs
- ReadOnlyAttribute.cs
- ToolStripItemBehavior.cs
- JoinGraph.cs
- CorePropertiesFilter.cs
- ListViewInsertEventArgs.cs
- CompressStream.cs
- WindowsAuthenticationModule.cs
- SmtpCommands.cs
- BezierSegment.cs
- InternalConfigRoot.cs
- MediaTimeline.cs
- Parser.cs
- TraceSection.cs
- StoreItemCollection.cs
- ClientConfigurationSystem.cs
- DebugManager.cs
- DbSetClause.cs
- WorkflowControlEndpoint.cs
- BindUriHelper.cs
- PackageFilter.cs
- SoapMessage.cs
- TimelineGroup.cs
- FrameworkElement.cs
- GridViewCellAutomationPeer.cs
- EventManager.cs
- XmlValidatingReaderImpl.cs
- CompositeControl.cs
- TypeDescriptorContext.cs
- AdapterDictionary.cs
- BaseDataListPage.cs
- ListItemCollection.cs
- MetadataImporter.cs
- EventEntry.cs
- Method.cs
- Knowncolors.cs
- DesignerUtility.cs
- AnchoredBlock.cs
- HttpRequest.cs
- ProjectionCamera.cs
- HttpConfigurationSystem.cs
- DataException.cs
- StrokeRenderer.cs
- DiagnosticTraceSource.cs
- EditingCommands.cs
- UnSafeCharBuffer.cs
- WizardStepBase.cs
- JournalEntryListConverter.cs
- SpeechSynthesizer.cs
- CodeDomConfigurationHandler.cs
- SortKey.cs
- BindingValueChangedEventArgs.cs
- ElementProxy.cs
- FieldValue.cs
- HttpProxyCredentialType.cs
- DllNotFoundException.cs
- invalidudtexception.cs
- CacheVirtualItemsEvent.cs
- EntityContainerRelationshipSet.cs
- Misc.cs
- ValueTypePropertyReference.cs
- StructuredType.cs
- ServiceContractListItem.cs
- _PooledStream.cs
- CrossContextChannel.cs
- TransformationRules.cs
- DataGrid.cs
- IPGlobalProperties.cs
- MemberProjectedSlot.cs
- wmiprovider.cs
- SettingsContext.cs
- PeerResolverBindingElement.cs
- CodeExporter.cs
- AbsoluteQuery.cs
- TriState.cs
- CommandBinding.cs
- XhtmlBasicImageAdapter.cs
- ToolStripRenderEventArgs.cs
- SecurityUniqueId.cs