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
- OperationAbortedException.cs
- SqlDataSourceRefreshSchemaForm.cs
- Effect.cs
- HashHelper.cs
- DbCommandDefinition.cs
- ParameterCollection.cs
- WebPartTransformer.cs
- ButtonFlatAdapter.cs
- CodeDomConfigurationHandler.cs
- HMAC.cs
- PersonalizationDictionary.cs
- ScriptingScriptResourceHandlerSection.cs
- DateTimeConstantAttribute.cs
- XmlProcessingInstruction.cs
- StrokeRenderer.cs
- BamlRecords.cs
- ProxyFragment.cs
- SizeFConverter.cs
- Int16KeyFrameCollection.cs
- AddInController.cs
- ObjectDataSourceEventArgs.cs
- JoinSymbol.cs
- Hex.cs
- TextElementCollectionHelper.cs
- ConnectionPoint.cs
- _ListenerAsyncResult.cs
- XmlReader.cs
- WindowsSecurityTokenAuthenticator.cs
- RoutedEventConverter.cs
- DataColumnPropertyDescriptor.cs
- SizeChangedEventArgs.cs
- SignatureGenerator.cs
- State.cs
- RectangleF.cs
- SystemInfo.cs
- NumberFormatInfo.cs
- _SslStream.cs
- ChangePassword.cs
- SettingsProperty.cs
- PKCS1MaskGenerationMethod.cs
- JournalNavigationScope.cs
- InternalControlCollection.cs
- WebServiceTypeData.cs
- TypeSchema.cs
- TimelineGroup.cs
- ExpressionVisitor.cs
- ExpressionCopier.cs
- ColumnClickEvent.cs
- SqlTypesSchemaImporter.cs
- cookieexception.cs
- IUnknownConstantAttribute.cs
- UnionCqlBlock.cs
- GregorianCalendar.cs
- SafeNativeMethodsCLR.cs
- HitTestResult.cs
- CurrentChangedEventManager.cs
- ChannelSinkStacks.cs
- MobileUserControlDesigner.cs
- WindowsListViewItemStartMenu.cs
- MappingSource.cs
- RecordBuilder.cs
- IList.cs
- ZoneMembershipCondition.cs
- OutOfProcStateClientManager.cs
- StreamedFramingRequestChannel.cs
- x509utils.cs
- QilStrConcat.cs
- SqlReferenceCollection.cs
- EntitySetDataBindingList.cs
- SocketException.cs
- AssemblySettingAttributes.cs
- Mutex.cs
- PagesChangedEventArgs.cs
- DataExpression.cs
- ContentPlaceHolder.cs
- XmlBindingWorker.cs
- ArraySortHelper.cs
- XmlFileEditor.cs
- XmlSignatureProperties.cs
- Html32TextWriter.cs
- CmsInterop.cs
- XmlSchemaExternal.cs
- BuildDependencySet.cs
- _ConnectStream.cs
- ProvidersHelper.cs
- SqlParameterizer.cs
- DiscoveryReferences.cs
- MultiBindingExpression.cs
- Certificate.cs
- XmlArrayAttribute.cs
- PolyLineSegment.cs
- WindowsRebar.cs
- IdnMapping.cs
- ServiceOperationListItemList.cs
- SQLString.cs
- FrameworkReadOnlyPropertyMetadata.cs
- DbConnectionStringCommon.cs
- TimeSpanMinutesConverter.cs
- Size.cs
- ImageBrush.cs