Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- LinkedResource.cs
- ProfilePropertySettings.cs
- CodeArrayIndexerExpression.cs
- CharacterBufferReference.cs
- PartManifestEntry.cs
- AllowedAudienceUriElementCollection.cs
- RawStylusInputCustomData.cs
- DynamicValueConverter.cs
- SchemaCollectionPreprocessor.cs
- SQLDecimalStorage.cs
- CodeCatchClauseCollection.cs
- LeafCellTreeNode.cs
- TdsParserSafeHandles.cs
- XmlMessageFormatter.cs
- DynamicMethod.cs
- BuildProvidersCompiler.cs
- PageBuildProvider.cs
- PathGradientBrush.cs
- AspCompat.cs
- DataGridPagerStyle.cs
- MemberDomainMap.cs
- MouseActionValueSerializer.cs
- EventMappingSettingsCollection.cs
- DataPointer.cs
- SecurityContextSecurityTokenParameters.cs
- QilName.cs
- HttpListenerException.cs
- Site.cs
- BitmapEffectDrawing.cs
- DynamicQueryableWrapper.cs
- Hash.cs
- DecimalKeyFrameCollection.cs
- ListViewItemSelectionChangedEvent.cs
- RemoteCryptoDecryptRequest.cs
- OdbcConnectionStringbuilder.cs
- ExceptionValidationRule.cs
- RichTextBox.cs
- GeometryCombineModeValidation.cs
- MembershipValidatePasswordEventArgs.cs
- DataGridViewRowCollection.cs
- ColumnWidthChangingEvent.cs
- EventDescriptorCollection.cs
- QueryGenerator.cs
- LayoutTable.cs
- HtmlForm.cs
- BackgroundWorker.cs
- ErrorStyle.cs
- Window.cs
- ProcessModelInfo.cs
- SocketException.cs
- CommonGetThemePartSize.cs
- DynamicPropertyHolder.cs
- WaitForChangedResult.cs
- EditingCoordinator.cs
- FixedSOMContainer.cs
- EventDescriptor.cs
- ScriptRef.cs
- ConvertEvent.cs
- HtmlControl.cs
- Matrix3DConverter.cs
- EntryPointNotFoundException.cs
- AdCreatedEventArgs.cs
- ActiveDocumentEvent.cs
- GroupStyle.cs
- XmlSerializer.cs
- DataGridComponentEditor.cs
- httpstaticobjectscollection.cs
- InstanceCreationEditor.cs
- SvcMapFileLoader.cs
- SerializationInfo.cs
- HandleExceptionArgs.cs
- _LocalDataStoreMgr.cs
- _AuthenticationState.cs
- Exceptions.cs
- SqlRowUpdatedEvent.cs
- PersonalizationStateQuery.cs
- StringToken.cs
- EraserBehavior.cs
- DataListCommandEventArgs.cs
- graph.cs
- RuleSettingsCollection.cs
- TypeSystem.cs
- PropertyChangingEventArgs.cs
- EncodingNLS.cs
- UpdateRecord.cs
- AndCondition.cs
- GridPatternIdentifiers.cs
- XmlAttributeCache.cs
- PeerEndPoint.cs
- SupportsEventValidationAttribute.cs
- ControlCollection.cs
- SectionVisual.cs
- Camera.cs
- LineServicesCallbacks.cs
- BindingWorker.cs
- FontWeightConverter.cs
- DataGridViewTopRowAccessibleObject.cs
- RoutedEventValueSerializer.cs
- StrongNameMembershipCondition.cs
- LogEntryHeaderv1Deserializer.cs