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
- ProfileGroupSettings.cs
- SqlErrorCollection.cs
- ToolStripSplitStackLayout.cs
- RangeBaseAutomationPeer.cs
- UniqueID.cs
- SolidColorBrush.cs
- ItemCheckEvent.cs
- TextSelectionProcessor.cs
- SourceFileBuildProvider.cs
- PrimitiveXmlSerializers.cs
- RedirectionProxy.cs
- BamlReader.cs
- ColorConverter.cs
- DPCustomTypeDescriptor.cs
- SqlDataAdapter.cs
- XmlSchemaObject.cs
- SmtpReplyReaderFactory.cs
- AuthenticationService.cs
- WebPartZoneBase.cs
- StringUtil.cs
- ActivityStatusChangeEventArgs.cs
- FileLoadException.cs
- XPathDocumentBuilder.cs
- Stacktrace.cs
- ActionFrame.cs
- HttpFileCollectionWrapper.cs
- NameTable.cs
- GridViewSelectEventArgs.cs
- VerticalAlignConverter.cs
- BindingCompleteEventArgs.cs
- QueryOperatorEnumerator.cs
- ExtenderProviderService.cs
- RegexMatchCollection.cs
- CodeAttributeArgument.cs
- ExpressionSelection.cs
- StackBuilderSink.cs
- SessionStateItemCollection.cs
- SizeAnimationBase.cs
- HighlightComponent.cs
- ChannelFactoryRefCache.cs
- StyleModeStack.cs
- WhiteSpaceTrimStringConverter.cs
- FileLevelControlBuilderAttribute.cs
- Vector.cs
- LazyTextWriterCreator.cs
- Size.cs
- DiffuseMaterial.cs
- Int16Storage.cs
- XmlBinaryReader.cs
- ConfigXmlElement.cs
- RawAppCommandInputReport.cs
- Padding.cs
- DefaultPropertyAttribute.cs
- _UriSyntax.cs
- DispatcherHooks.cs
- QilLiteral.cs
- DataBoundControlDesigner.cs
- NestedContainer.cs
- Int32.cs
- Scheduling.cs
- OdbcPermission.cs
- XmlSchemaProviderAttribute.cs
- CodeLinePragma.cs
- CrossSiteScriptingValidation.cs
- TableProviderWrapper.cs
- TransformerTypeCollection.cs
- ReflectPropertyDescriptor.cs
- StylusButtonCollection.cs
- DataProtection.cs
- TextServicesCompartmentEventSink.cs
- DataSourceCache.cs
- SerializationFieldInfo.cs
- SQLDateTime.cs
- TagMapInfo.cs
- NodeInfo.cs
- CoreSwitches.cs
- SingleSelectRootGridEntry.cs
- ServiceOperationHelpers.cs
- TypeDescriptor.cs
- AvTrace.cs
- TranslateTransform3D.cs
- TextSpan.cs
- JavaScriptSerializer.cs
- __FastResourceComparer.cs
- DbConnectionHelper.cs
- SmiMetaDataProperty.cs
- ThicknessKeyFrameCollection.cs
- CompressEmulationStream.cs
- WorkflowPrinting.cs
- CLSCompliantAttribute.cs
- XmlnsPrefixAttribute.cs
- PropertyRecord.cs
- Environment.cs
- ResourceBinder.cs
- Comparer.cs
- PropertyOrder.cs
- WindowsEditBoxRange.cs
- RelatedEnd.cs
- WebPartAuthorizationEventArgs.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs