Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- ContractsBCL.cs
- ContainerFilterService.cs
- SelectionPatternIdentifiers.cs
- NameValuePair.cs
- SamlSubjectStatement.cs
- PermissionListSet.cs
- TableLayoutSettings.cs
- ContainerUtilities.cs
- Accessible.cs
- Padding.cs
- ErrorWrapper.cs
- ToolBar.cs
- ToolStripArrowRenderEventArgs.cs
- SendParametersContent.cs
- RSAProtectedConfigurationProvider.cs
- Focus.cs
- TemplateBindingExpressionConverter.cs
- CapabilitiesUse.cs
- MembershipUser.cs
- DetailsViewCommandEventArgs.cs
- BasePattern.cs
- DataGridSortCommandEventArgs.cs
- HandleValueEditor.cs
- CodeDelegateInvokeExpression.cs
- Attributes.cs
- RenderDataDrawingContext.cs
- DoubleAnimationBase.cs
- PatternMatcher.cs
- ManifestBasedResourceGroveler.cs
- BitConverter.cs
- MediaScriptCommandRoutedEventArgs.cs
- SafeHandles.cs
- CompareValidator.cs
- InvocationExpression.cs
- Regex.cs
- SqlStatistics.cs
- UDPClient.cs
- TaiwanLunisolarCalendar.cs
- ContainerParagraph.cs
- ConfigXmlWhitespace.cs
- BooleanAnimationBase.cs
- HttpRuntime.cs
- TypeTypeConverter.cs
- UnmanagedMarshal.cs
- HtmlHead.cs
- TableSectionStyle.cs
- CroppedBitmap.cs
- GridPattern.cs
- TreeNode.cs
- GenericRootAutomationPeer.cs
- BorderGapMaskConverter.cs
- XmlBinaryReader.cs
- ContentElement.cs
- DecimalAnimationBase.cs
- ProtocolsConfiguration.cs
- AdornerDecorator.cs
- BitmapPalette.cs
- ToolStripCustomTypeDescriptor.cs
- ZoneButton.cs
- GlyphingCache.cs
- FormsAuthenticationCredentials.cs
- OneOfScalarConst.cs
- RightsManagementPermission.cs
- ImpersonateTokenRef.cs
- CalendarDataBindingHandler.cs
- ColorAnimationUsingKeyFrames.cs
- Policy.cs
- HttpEncoderUtility.cs
- ContainerParaClient.cs
- EmbeddedMailObjectsCollection.cs
- EndpointAddress.cs
- XsdBuilder.cs
- GenericUriParser.cs
- MessageFilterException.cs
- SqlTypeConverter.cs
- OleDbReferenceCollection.cs
- NamespaceEmitter.cs
- KeyBinding.cs
- BooleanKeyFrameCollection.cs
- Crc32.cs
- SingleTagSectionHandler.cs
- GridToolTip.cs
- WebSysDefaultValueAttribute.cs
- PointAnimationUsingKeyFrames.cs
- ClonableStack.cs
- GeneralTransform3D.cs
- OleAutBinder.cs
- FunctionDefinition.cs
- AttachedPropertyMethodSelector.cs
- XmlChildEnumerator.cs
- SizeAnimationBase.cs
- EntityContainer.cs
- TraceHandler.cs
- DrawingBrush.cs
- EventSinkActivity.cs
- ConstructorBuilder.cs
- SymLanguageVendor.cs
- QilInvoke.cs
- FactoryMaker.cs
- ActivityValidationServices.cs