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
- WebPartCatalogAddVerb.cs
- HttpRawResponse.cs
- LinearKeyFrames.cs
- Rule.cs
- ExtractedStateEntry.cs
- PolyBezierSegmentFigureLogic.cs
- Matrix3D.cs
- DataGridViewCellConverter.cs
- PrintController.cs
- HandleRef.cs
- WindowsNonControl.cs
- ParserContext.cs
- BinHexEncoding.cs
- ObjectNavigationPropertyMapping.cs
- EntityDataSourceEntitySetNameItem.cs
- SupportedAddressingMode.cs
- _ConnectStream.cs
- BoundConstants.cs
- UrlMappingsSection.cs
- Splitter.cs
- ViewCellRelation.cs
- TaskFileService.cs
- XdrBuilder.cs
- SharedPersonalizationStateInfo.cs
- CommandTreeTypeHelper.cs
- XMLDiffLoader.cs
- TextRangeBase.cs
- SystemParameters.cs
- AuthorizationSection.cs
- _CacheStreams.cs
- ConstraintStruct.cs
- Logging.cs
- odbcmetadatacollectionnames.cs
- EntityKeyElement.cs
- ListViewContainer.cs
- Graphics.cs
- JumpPath.cs
- ColumnWidthChangedEvent.cs
- RefType.cs
- DbProviderFactory.cs
- ServiceModelConfigurationSectionCollection.cs
- Roles.cs
- ArraySortHelper.cs
- LogExtent.cs
- ZipIOLocalFileHeader.cs
- StorageSetMapping.cs
- DockPattern.cs
- EventLogger.cs
- Propagator.JoinPropagator.JoinPredicateVisitor.cs
- DocumentSequenceHighlightLayer.cs
- RectangleHotSpot.cs
- WebServiceData.cs
- Control.cs
- BlurEffect.cs
- DeobfuscatingStream.cs
- ObjectQuery.cs
- GridViewColumnHeaderAutomationPeer.cs
- WebPart.cs
- MouseActionValueSerializer.cs
- XmlSchemaComplexContentRestriction.cs
- TextTreeFixupNode.cs
- XmlElementList.cs
- ApplyImportsAction.cs
- PropertyMappingExceptionEventArgs.cs
- ViewStateModeByIdAttribute.cs
- RootBuilder.cs
- PipeStream.cs
- XmlSchemaSimpleTypeUnion.cs
- ScrollEvent.cs
- GenericWebPart.cs
- HTMLTagNameToTypeMapper.cs
- WebZone.cs
- WebPartVerb.cs
- sitestring.cs
- ObjectStateEntryOriginalDbUpdatableDataRecord.cs
- PageCodeDomTreeGenerator.cs
- GeneralTransformCollection.cs
- InsufficientMemoryException.cs
- Renderer.cs
- TableHeaderCell.cs
- MethodBuilder.cs
- SiteMapNodeCollection.cs
- TextServicesDisplayAttribute.cs
- SystemResources.cs
- HwndHost.cs
- OrderByQueryOptionExpression.cs
- StrokeDescriptor.cs
- ToolStripRenderEventArgs.cs
- XmlSchemaType.cs
- NamedPipeProcessProtocolHandler.cs
- CodeMemberMethod.cs
- DescendantBaseQuery.cs
- handlecollector.cs
- EventSetter.cs
- AssemblyUtil.cs
- JsonReaderWriterFactory.cs
- UniqueIdentifierService.cs
- CompositeDispatchFormatter.cs
- DbConnectionStringCommon.cs
- _ListenerAsyncResult.cs