Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- OptimisticConcurrencyException.cs
- Freezable.cs
- FacetValues.cs
- X509Certificate2.cs
- ApplicationInfo.cs
- EntityDataSourceEntitySetNameItem.cs
- Unit.cs
- safelink.cs
- OperationCanceledException.cs
- XmlDataSourceView.cs
- DataExpression.cs
- ObjectCloneHelper.cs
- PageAsyncTask.cs
- HttpApplication.cs
- SQLDouble.cs
- SmtpDigestAuthenticationModule.cs
- JavaScriptObjectDeserializer.cs
- PageThemeBuildProvider.cs
- RequestQueue.cs
- ReflectionTypeLoadException.cs
- pingexception.cs
- MemberHolder.cs
- PreviewPrintController.cs
- CultureSpecificStringDictionary.cs
- ProxyFragment.cs
- Empty.cs
- XmlElementCollection.cs
- Permission.cs
- TraceSection.cs
- DeferredReference.cs
- SerialReceived.cs
- LogStream.cs
- DbUpdateCommandTree.cs
- FixedSOMTable.cs
- SchemaNotation.cs
- GifBitmapEncoder.cs
- DataBindingHandlerAttribute.cs
- _ChunkParse.cs
- ToolStripRendererSwitcher.cs
- DelayedRegex.cs
- JsonSerializer.cs
- Paragraph.cs
- documentation.cs
- RegexRunner.cs
- PartitionResolver.cs
- GZipStream.cs
- QilUnary.cs
- XMLUtil.cs
- FilterQuery.cs
- control.ime.cs
- DictionaryChange.cs
- MetadataUtil.cs
- AnimatedTypeHelpers.cs
- WCFModelStrings.Designer.cs
- InputProviderSite.cs
- HtmlInputText.cs
- KnowledgeBase.cs
- UrlPropertyAttribute.cs
- SymLanguageVendor.cs
- XmlSchemaObjectTable.cs
- DataTableMappingCollection.cs
- Membership.cs
- ImpersonationContext.cs
- PlainXmlWriter.cs
- selecteditemcollection.cs
- SyndicationSerializer.cs
- WebBrowserBase.cs
- SupportsEventValidationAttribute.cs
- ButtonChrome.cs
- DocumentApplication.cs
- NavigationService.cs
- NamespaceImport.cs
- HMAC.cs
- TypeSystem.cs
- ExcludeFromCodeCoverageAttribute.cs
- ImageMapEventArgs.cs
- RoutedEvent.cs
- BitmapEffectDrawingContent.cs
- WindowsButton.cs
- _ListenerRequestStream.cs
- SchemaCreator.cs
- Ray3DHitTestResult.cs
- XmlNavigatorFilter.cs
- RenderTargetBitmap.cs
- LockRecursionException.cs
- DetailsViewInsertEventArgs.cs
- DesignSurfaceServiceContainer.cs
- GlobalProxySelection.cs
- SizeKeyFrameCollection.cs
- Schema.cs
- LogicalChannel.cs
- SchemaTypeEmitter.cs
- MissingManifestResourceException.cs
- DataFormats.cs
- XmlDataSourceView.cs
- EditorPartCollection.cs
- Pen.cs
- MediaCommands.cs
- AttributeCollection.cs
- EntityContainerEmitter.cs