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
- RightsManagementInformation.cs
- DataBindingList.cs
- FrameworkElementFactory.cs
- ResourceExpressionBuilder.cs
- ColumnReorderedEventArgs.cs
- SqlEnums.cs
- SqlNodeAnnotations.cs
- EntityDataSourceState.cs
- DeflateStream.cs
- SmtpFailedRecipientsException.cs
- MonthCalendarDesigner.cs
- HttpModulesSection.cs
- DecoderExceptionFallback.cs
- EventHandlerList.cs
- HelpFileFileNameEditor.cs
- FontClient.cs
- SequenceDesigner.cs
- PrintDialog.cs
- ConfigurationElementCollection.cs
- ellipse.cs
- HierarchicalDataBoundControl.cs
- Control.cs
- BindingBase.cs
- ShutDownListener.cs
- PersonalizationProviderCollection.cs
- HttpListenerResponse.cs
- SingleResultAttribute.cs
- WebRequestModulesSection.cs
- SynchronizationValidator.cs
- RijndaelManaged.cs
- TypeUtils.cs
- MaskInputRejectedEventArgs.cs
- ThousandthOfEmRealPoints.cs
- SqlBulkCopy.cs
- AxisAngleRotation3D.cs
- XmlSchemaAttribute.cs
- ProfileSection.cs
- QueueSurrogate.cs
- ImageSource.cs
- VersionConverter.cs
- TrackBarRenderer.cs
- ButtonChrome.cs
- EdmConstants.cs
- QueryPrefixOp.cs
- InputLanguageCollection.cs
- designeractionbehavior.cs
- CodeDirectionExpression.cs
- CryptoHandle.cs
- ResizingMessageFilter.cs
- TypeDelegator.cs
- ITextView.cs
- WebPartTransformerCollection.cs
- XmlLangPropertyAttribute.cs
- DescendentsWalkerBase.cs
- Header.cs
- _CookieModule.cs
- DataContext.cs
- __Error.cs
- RuntimeConfigLKG.cs
- Permission.cs
- ListViewEditEventArgs.cs
- DiscoveryDocumentSerializer.cs
- XmlDocumentSerializer.cs
- InheritanceService.cs
- InProcStateClientManager.cs
- _SslStream.cs
- ButtonChrome.cs
- SynchronizedInputAdaptor.cs
- Asn1IntegerConverter.cs
- AppDomainManager.cs
- Table.cs
- OrderedDictionaryStateHelper.cs
- HandlerMappingMemo.cs
- TriggerAction.cs
- MouseDevice.cs
- VirtualizingStackPanel.cs
- SortableBindingList.cs
- PackageStore.cs
- XmlWhitespace.cs
- _SslStream.cs
- SecurityChannelFaultConverter.cs
- NotFiniteNumberException.cs
- Point3DCollection.cs
- Clock.cs
- DynamicMethod.cs
- SerializationTrace.cs
- DrawingVisual.cs
- Int32Storage.cs
- MessageUtil.cs
- UnsafeNetInfoNativeMethods.cs
- WebPartPersonalization.cs
- XmlSchemaRedefine.cs
- SecurityManager.cs
- CompiledXpathExpr.cs
- DefaultTraceListener.cs
- Binding.cs
- EntityParameterCollection.cs
- XmlWrappingWriter.cs
- WebPartExportVerb.cs
- AuthenticationSection.cs