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
- Splitter.cs
- DocumentViewerAutomationPeer.cs
- jithelpers.cs
- TargetConverter.cs
- RangeValuePatternIdentifiers.cs
- LogSwitch.cs
- LicenseException.cs
- CustomLineCap.cs
- ReadOnlyDataSource.cs
- WsdlWriter.cs
- CuspData.cs
- Serializer.cs
- IndexExpression.cs
- AttributeQuery.cs
- SqlMetaData.cs
- GetImportedCardRequest.cs
- SharedPersonalizationStateInfo.cs
- SocketManager.cs
- MasterPage.cs
- XmlSchemaProviderAttribute.cs
- TranslateTransform3D.cs
- AssemblyAttributes.cs
- DuplicateWaitObjectException.cs
- _ListenerAsyncResult.cs
- WebPartHelpVerb.cs
- IRCollection.cs
- VisualTreeUtils.cs
- DataControlImageButton.cs
- SqlDependency.cs
- FormatVersion.cs
- ReferencedCollectionType.cs
- Monitor.cs
- DefaultTextStore.cs
- PauseStoryboard.cs
- StoryFragments.cs
- MultiTrigger.cs
- SqlXml.cs
- KernelTypeValidation.cs
- SkinBuilder.cs
- GlyphInfoList.cs
- LogStream.cs
- ComboBox.cs
- ScriptResourceMapping.cs
- CharacterMetrics.cs
- CacheModeValueSerializer.cs
- LogExtent.cs
- SapiRecognizer.cs
- Root.cs
- __Error.cs
- ListManagerBindingsCollection.cs
- InstanceCollisionException.cs
- ApplicationServiceHelper.cs
- BitmapEffectDrawingContent.cs
- IconEditor.cs
- AbstractExpressions.cs
- CodeCatchClause.cs
- SimpleHandlerBuildProvider.cs
- AssociationSet.cs
- PagedDataSource.cs
- CmsUtils.cs
- RegionData.cs
- OleDbRowUpdatingEvent.cs
- MaterialCollection.cs
- clipboard.cs
- PrimitiveXmlSerializers.cs
- Control.cs
- RequestQueryProcessor.cs
- CompiledELinqQueryState.cs
- Encoding.cs
- DebuggerAttributes.cs
- COM2TypeInfoProcessor.cs
- DataGridViewRowHeightInfoNeededEventArgs.cs
- WorkflowInlining.cs
- Registry.cs
- DurationConverter.cs
- TypeBuilder.cs
- ISFClipboardData.cs
- SymbolUsageManager.cs
- CopyNodeSetAction.cs
- ServiceDescriptionImporter.cs
- Win32.cs
- RSACryptoServiceProvider.cs
- ReverseInheritProperty.cs
- WindowPatternIdentifiers.cs
- EncryptedPackageFilter.cs
- MaskedTextBox.cs
- SQLByteStorage.cs
- VirtualizingPanel.cs
- StopStoryboard.cs
- BindingMAnagerBase.cs
- SqlUdtInfo.cs
- ClonableStack.cs
- Point4DConverter.cs
- ListManagerBindingsCollection.cs
- DependencyPropertyDescriptor.cs
- control.ime.cs
- FunctionDescription.cs
- ToolStripGrip.cs
- RegistryKey.cs
- DependencyProperty.cs