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
- HtmlEmptyTagControlBuilder.cs
- EntityDataSourceViewSchema.cs
- Compiler.cs
- Walker.cs
- DefaultAutoFieldGenerator.cs
- MailBnfHelper.cs
- FontWeights.cs
- XmlSchemaRedefine.cs
- safelink.cs
- NotificationContext.cs
- WebContext.cs
- CategoryAttribute.cs
- DocumentPaginator.cs
- StringFunctions.cs
- AlignmentXValidation.cs
- WebRequestModuleElementCollection.cs
- HtmlInputText.cs
- WebPartsSection.cs
- AnnotationHelper.cs
- ResponseStream.cs
- WebScriptEnablingElement.cs
- UrlMappingsSection.cs
- TabControlEvent.cs
- ImageListStreamer.cs
- CodeNamespaceImport.cs
- EntityTypeEmitter.cs
- XmlSerializerFactory.cs
- XamlPathDataSerializer.cs
- ComponentResourceKey.cs
- diagnosticsswitches.cs
- RuntimeConfig.cs
- SelectedCellsChangedEventArgs.cs
- Hash.cs
- PasswordValidationException.cs
- EmissiveMaterial.cs
- AuthenticationService.cs
- WindowsPrincipal.cs
- NativeObjectSecurity.cs
- SecureStringHasher.cs
- HtmlForm.cs
- TriggerActionCollection.cs
- BitmapEffectDrawing.cs
- CompiledELinqQueryState.cs
- ToolStripScrollButton.cs
- AssemblyName.cs
- BaseTransportHeaders.cs
- IxmlLineInfo.cs
- DataColumnCollection.cs
- GlyphRun.cs
- GB18030Encoding.cs
- StyleTypedPropertyAttribute.cs
- WinEventQueueItem.cs
- SessionIDManager.cs
- XmlWrappingWriter.cs
- InterleavedZipPartStream.cs
- SafeReversePInvokeHandle.cs
- SspiWrapper.cs
- ResolveMatchesCD1.cs
- CallbackHandler.cs
- XmlSiteMapProvider.cs
- MediaTimeline.cs
- TwoPhaseCommitProxy.cs
- elementinformation.cs
- HierarchicalDataSourceConverter.cs
- UriTemplateMatch.cs
- RequestUriProcessor.cs
- TextEditorSpelling.cs
- ZipIOCentralDirectoryBlock.cs
- TaskCanceledException.cs
- PriorityRange.cs
- CorrelationService.cs
- Help.cs
- _AcceptOverlappedAsyncResult.cs
- AutoResetEvent.cs
- ButtonBaseAutomationPeer.cs
- DataFormats.cs
- XamlInterfaces.cs
- ZoneLinkButton.cs
- NativeActivityMetadata.cs
- EditorPartChrome.cs
- MetadataUtilsSmi.cs
- HttpValueCollection.cs
- SQLDateTime.cs
- DNS.cs
- PageWrapper.cs
- TypeSystemProvider.cs
- KerberosSecurityTokenProvider.cs
- BaseCollection.cs
- GeometryModel3D.cs
- CatalogPartCollection.cs
- PropVariant.cs
- CodeAccessSecurityEngine.cs
- ColorAnimationBase.cs
- ServiceDesigner.cs
- XmlWellformedWriter.cs
- ReadOnlyDictionary.cs
- SubclassTypeValidator.cs
- SchemaSetCompiler.cs
- PreviewKeyDownEventArgs.cs
- WebPartChrome.cs