Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Metadata / Edm / safelink.cs / 1305376 / safelink.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //---------------------------------------------------------------------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
- InvalidFilterCriteriaException.cs
- WindowsFormsHostAutomationPeer.cs
- ProfessionalColorTable.cs
- BasicExpandProvider.cs
- IIS7ConfigurationLoader.cs
- SqlDuplicator.cs
- keycontainerpermission.cs
- WSFederationHttpSecurityMode.cs
- OutputCacheSection.cs
- JavaScriptString.cs
- SwitchExpression.cs
- PtsPage.cs
- IncrementalReadDecoders.cs
- FontDifferentiator.cs
- Repeater.cs
- VSWCFServiceContractGenerator.cs
- IndentedWriter.cs
- ModelMemberCollection.cs
- XmlSchemaGroup.cs
- FlowDocument.cs
- EntityTypeEmitter.cs
- ParserHooks.cs
- BitmapEffectGroup.cs
- DependencyObject.cs
- DeclaredTypeElementCollection.cs
- SoapSchemaMember.cs
- SHA1CryptoServiceProvider.cs
- IDReferencePropertyAttribute.cs
- Scheduler.cs
- WindowsTokenRoleProvider.cs
- WinCategoryAttribute.cs
- TextServicesHost.cs
- XmlArrayItemAttributes.cs
- RemoteWebConfigurationHost.cs
- EncryptedPackage.cs
- MD5.cs
- DetailsViewModeEventArgs.cs
- DataGridViewSelectedCellCollection.cs
- Memoizer.cs
- ILGenerator.cs
- FacetEnabledSchemaElement.cs
- Quaternion.cs
- ExpressionVisitor.cs
- ContainerParagraph.cs
- GridViewColumn.cs
- StrongTypingException.cs
- TreeWalker.cs
- PointLightBase.cs
- RectValueSerializer.cs
- GlyphCache.cs
- XmlEncoding.cs
- RSAPKCS1SignatureDeformatter.cs
- WebPartEditorCancelVerb.cs
- ListViewContainer.cs
- ZoneIdentityPermission.cs
- MtomMessageEncoder.cs
- VSWCFServiceContractGenerator.cs
- TextEditorTables.cs
- ReferentialConstraint.cs
- EventLogEntry.cs
- OleDbFactory.cs
- EditorBrowsableAttribute.cs
- XmlSchemaComplexContentRestriction.cs
- TouchFrameEventArgs.cs
- Point3D.cs
- BatchStream.cs
- Empty.cs
- BufferedGraphics.cs
- CheckBoxBaseAdapter.cs
- IIS7UserPrincipal.cs
- EndpointDispatcher.cs
- InputLanguageSource.cs
- ThreadExceptionEvent.cs
- SurrogateChar.cs
- NativeMethods.cs
- CapabilitiesPattern.cs
- MessageQueuePermissionEntryCollection.cs
- SqlProfileProvider.cs
- DbModificationClause.cs
- UnsafePeerToPeerMethods.cs
- Executor.cs
- LassoSelectionBehavior.cs
- StructuralObject.cs
- InstanceDescriptor.cs
- TdsParserHelperClasses.cs
- CroppedBitmap.cs
- DefaultCommandExtensionCallback.cs
- Regex.cs
- BitStack.cs
- HttpResponseHeader.cs
- UIElement3D.cs
- UInt32.cs
- ExternalCalls.cs
- UnwrappedTypesXmlSerializerManager.cs
- StaticDataManager.cs
- CompositeScriptReferenceEventArgs.cs
- WindowsGrip.cs
- Set.cs
- TemplatePagerField.cs
- MediaTimeline.cs