Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- SqlCaseSimplifier.cs
- DataServiceContext.cs
- GridViewColumnCollection.cs
- RowsCopiedEventArgs.cs
- SHA1Managed.cs
- base64Transforms.cs
- StorageInfo.cs
- FormViewCommandEventArgs.cs
- MouseGestureValueSerializer.cs
- Vector3DCollectionConverter.cs
- ProxyAttribute.cs
- VerificationException.cs
- ContextMenu.cs
- ServiceNameElementCollection.cs
- BitmapData.cs
- TreeBuilder.cs
- CodeParameterDeclarationExpression.cs
- StreamInfo.cs
- Addressing.cs
- SqlUDTStorage.cs
- Vector3DIndependentAnimationStorage.cs
- HashRepartitionStream.cs
- TextWriterTraceListener.cs
- ConnectionProviderAttribute.cs
- MatrixAnimationUsingKeyFrames.cs
- CodeBlockBuilder.cs
- JapaneseLunisolarCalendar.cs
- StorageScalarPropertyMapping.cs
- TypeHelpers.cs
- SiteMapPathDesigner.cs
- ImageSource.cs
- XmlValueConverter.cs
- ControlEvent.cs
- CodeObject.cs
- ServiceOperationWrapper.cs
- ToolboxDataAttribute.cs
- PrinterUnitConvert.cs
- Char.cs
- ProcessModelInfo.cs
- DefaultEvaluationContext.cs
- XmlSchemaComplexType.cs
- MatrixValueSerializer.cs
- DataControlPagerLinkButton.cs
- FullTextBreakpoint.cs
- ExternalCalls.cs
- HitTestWithGeometryDrawingContextWalker.cs
- FileNotFoundException.cs
- SerializerDescriptor.cs
- HtmlListAdapter.cs
- VolatileEnlistmentMultiplexing.cs
- TimeSpanConverter.cs
- PageAdapter.cs
- DataGridColumn.cs
- ValidationResult.cs
- Win32KeyboardDevice.cs
- ThreadBehavior.cs
- PropertyDescriptorCollection.cs
- DummyDataSource.cs
- TaskCanceledException.cs
- SqlRowUpdatedEvent.cs
- DecoderFallbackWithFailureFlag.cs
- EventLogReader.cs
- LineSegment.cs
- ProviderUtil.cs
- ToolboxItem.cs
- PropertyOverridesTypeEditor.cs
- SuppressMergeCheckAttribute.cs
- Nodes.cs
- ConnectionOrientedTransportManager.cs
- ItemDragEvent.cs
- TreeNode.cs
- BuilderInfo.cs
- tabpagecollectioneditor.cs
- ModuleElement.cs
- RawStylusSystemGestureInputReport.cs
- ReservationCollection.cs
- XamlTreeBuilderBamlRecordWriter.cs
- GeneralTransformGroup.cs
- SubMenuStyle.cs
- PasswordRecovery.cs
- StartUpEventArgs.cs
- CodeCommentStatement.cs
- CompilerState.cs
- MenuItemStyle.cs
- HuffCodec.cs
- ClientUtils.cs
- NestedContainer.cs
- WebExceptionStatus.cs
- ApplyHostConfigurationBehavior.cs
- TypeUtils.cs
- RemotingConfiguration.cs
- IntegerValidatorAttribute.cs
- DataMisalignedException.cs
- IPPacketInformation.cs
- RoutedEventArgs.cs
- CallbackHandler.cs
- ResXResourceSet.cs
- OdbcParameter.cs
- DesigntimeLicenseContext.cs
- DataObjectMethodAttribute.cs