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
- RelationshipFixer.cs
- MessageSecurityOverMsmqElement.cs
- mediapermission.cs
- TextDecoration.cs
- RawStylusInputReport.cs
- BaseCollection.cs
- DbFunctionCommandTree.cs
- XmlUtil.cs
- MexServiceChannelBuilder.cs
- InheritedPropertyChangedEventArgs.cs
- SrgsDocument.cs
- CodeMemberField.cs
- CoTaskMemHandle.cs
- TreeNodeBindingCollection.cs
- DocumentSequenceHighlightLayer.cs
- CultureTableRecord.cs
- DefaultValueAttribute.cs
- CommandValueSerializer.cs
- TemplateBuilder.cs
- HttpApplication.cs
- KeyFrames.cs
- FrameDimension.cs
- HostingPreferredMapPath.cs
- Point3DKeyFrameCollection.cs
- SqlRowUpdatingEvent.cs
- ClearTypeHintValidation.cs
- PageCanvasSize.cs
- PostBackTrigger.cs
- MetadataPropertyCollection.cs
- WorkflowItemPresenter.cs
- StatusBarItem.cs
- FixedFindEngine.cs
- ComponentCollection.cs
- TypeGeneratedEventArgs.cs
- DbQueryCommandTree.cs
- DocumentReferenceCollection.cs
- ReversePositionQuery.cs
- RoutedPropertyChangedEventArgs.cs
- HuffCodec.cs
- SmiXetterAccessMap.cs
- Matrix3DStack.cs
- XmlBinaryReader.cs
- DataObjectPastingEventArgs.cs
- DataGridViewTopLeftHeaderCell.cs
- XmlSchemaSimpleTypeList.cs
- VisualBrush.cs
- TagPrefixInfo.cs
- IItemContainerGenerator.cs
- TextCharacters.cs
- CodeMethodReturnStatement.cs
- TagMapInfo.cs
- StrokeCollectionDefaultValueFactory.cs
- InternalDispatchObject.cs
- ContentValidator.cs
- XmlBinaryReader.cs
- Closure.cs
- CodeCommentStatementCollection.cs
- DirectoryInfo.cs
- ItemList.cs
- MemberDescriptor.cs
- PropertyItemInternal.cs
- DynamicDiscoSearcher.cs
- UIInitializationException.cs
- DataGridCell.cs
- SectionVisual.cs
- ConfigurationValue.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- Size3DConverter.cs
- DirtyTextRange.cs
- HttpPostProtocolImporter.cs
- LogEntry.cs
- Empty.cs
- SystemPens.cs
- SqlBinder.cs
- KeyboardEventArgs.cs
- ColorMatrix.cs
- SimpleNameService.cs
- LinqDataSourceContextData.cs
- InternalRelationshipCollection.cs
- FormsAuthenticationUserCollection.cs
- SqlTriggerAttribute.cs
- SerializationStore.cs
- Header.cs
- DockingAttribute.cs
- GradientBrush.cs
- ExtendedPropertyDescriptor.cs
- CheckPair.cs
- UDPClient.cs
- CodeDomDesignerLoader.cs
- RuleInfoComparer.cs
- DataGridViewEditingControlShowingEventArgs.cs
- BufferedGraphicsManager.cs
- GridViewColumn.cs
- PlaceHolder.cs
- BinaryObjectReader.cs
- QueryContinueDragEventArgs.cs
- GroupBoxRenderer.cs
- UpdateRecord.cs
- TypeListConverter.cs
- Keywords.cs