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
- VisualStyleElement.cs
- Maps.cs
- Html32TextWriter.cs
- ITextView.cs
- MouseButtonEventArgs.cs
- GridViewColumn.cs
- serverconfig.cs
- AppDomainAttributes.cs
- CodeExporter.cs
- ClickablePoint.cs
- DataStreams.cs
- AssociationSetMetadata.cs
- FileSystemInfo.cs
- ManagementException.cs
- GenericsInstances.cs
- HttpBufferlessInputStream.cs
- MetadataUtil.cs
- OdbcConnectionHandle.cs
- Random.cs
- ChtmlLinkAdapter.cs
- DbSetClause.cs
- Message.cs
- SpecularMaterial.cs
- SafePEFileHandle.cs
- NodeLabelEditEvent.cs
- Membership.cs
- UserValidatedEventArgs.cs
- EmbeddedMailObjectsCollection.cs
- PerformanceCounterPermission.cs
- EventLogPermission.cs
- WebPartUtil.cs
- HttpRuntime.cs
- ShimAsPublicXamlType.cs
- ExplicitDiscriminatorMap.cs
- BooleanKeyFrameCollection.cs
- ILGenerator.cs
- UnsafeNativeMethods.cs
- XpsException.cs
- HuffmanTree.cs
- XmlSchemaComplexType.cs
- HealthMonitoringSection.cs
- WinEventHandler.cs
- sortedlist.cs
- Point3DConverter.cs
- SerialPinChanges.cs
- TypedElement.cs
- SmtpFailedRecipientsException.cs
- LifetimeServices.cs
- DataGridViewRowPostPaintEventArgs.cs
- wmiutil.cs
- TypeLibConverter.cs
- ResetableIterator.cs
- DllNotFoundException.cs
- _ListenerRequestStream.cs
- Mapping.cs
- ScrollableControl.cs
- ImageDrawing.cs
- ModelUIElement3D.cs
- MruCache.cs
- XmlTextWriter.cs
- ToolStripProgressBar.cs
- AccessDataSource.cs
- IgnoreDeviceFilterElementCollection.cs
- AutomationProperties.cs
- ListChangedEventArgs.cs
- LogEntrySerializationException.cs
- AssertFilter.cs
- SelectionUIHandler.cs
- SqlInternalConnectionSmi.cs
- IntSecurity.cs
- TextSearch.cs
- CalendarAutoFormat.cs
- PersianCalendar.cs
- PersistenceTypeAttribute.cs
- WriteStateInfoBase.cs
- TextModifierScope.cs
- DateTimeValueSerializer.cs
- SrgsDocument.cs
- ConfigXmlText.cs
- MetadataExchangeBindings.cs
- PersonalizableTypeEntry.cs
- ObjectQuery_EntitySqlExtensions.cs
- XmlSchemaSet.cs
- MessageQueueInstaller.cs
- ActivityBuilder.cs
- UIElement3D.cs
- XamlHostingSection.cs
- ApplicationManager.cs
- MatrixTransform3D.cs
- DefaultHttpHandler.cs
- BinHexDecoder.cs
- GeometryHitTestResult.cs
- ClrProviderManifest.cs
- HtmlTableRowCollection.cs
- SqlNotificationEventArgs.cs
- ChildTable.cs
- ContractCodeDomInfo.cs
- ToolStripKeyboardHandlingService.cs
- DLinqDataModelProvider.cs
- mactripleDES.cs