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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DockPattern.cs
- RotateTransform3D.cs
- EnumType.cs
- LinearGradientBrush.cs
- DbProviderSpecificTypePropertyAttribute.cs
- RSAPKCS1SignatureFormatter.cs
- RawTextInputReport.cs
- CqlIdentifiers.cs
- Duration.cs
- PipeSecurity.cs
- MultiDataTrigger.cs
- AssemblyBuilder.cs
- ComplexPropertyEntry.cs
- ValidationSummary.cs
- PrintPageEvent.cs
- LingerOption.cs
- Vector3DCollectionValueSerializer.cs
- Preprocessor.cs
- XmlTextReaderImplHelpers.cs
- SparseMemoryStream.cs
- UiaCoreTypesApi.cs
- _SafeNetHandles.cs
- AccessDataSourceView.cs
- MultiBindingExpression.cs
- TextSearch.cs
- SQLCharsStorage.cs
- SequentialUshortCollection.cs
- RecognizeCompletedEventArgs.cs
- PopupControlService.cs
- DataSource.cs
- ContentPresenter.cs
- QilParameter.cs
- ImageSourceConverter.cs
- PersistenceProviderDirectory.cs
- WebPartZoneCollection.cs
- FamilyTypeface.cs
- InheritanceContextHelper.cs
- UriExt.cs
- XmlSerializationReader.cs
- ReadOnlyTernaryTree.cs
- WindowsTab.cs
- GlyphTypeface.cs
- XhtmlBasicLinkAdapter.cs
- FilePrompt.cs
- SimpleExpression.cs
- MobileRedirect.cs
- RepeaterItem.cs
- PersonalizablePropertyEntry.cs
- MailAddressParser.cs
- SrgsElementList.cs
- DataTableReader.cs
- XmlAutoDetectWriter.cs
- ClientBuildManagerTypeDescriptionProviderBridge.cs
- MimeTypeMapper.cs
- GraphicsPathIterator.cs
- ProxyWebPart.cs
- ProbeDuplexCD1AsyncResult.cs
- OciLobLocator.cs
- GACIdentityPermission.cs
- altserialization.cs
- SerializationSectionGroup.cs
- SafeCryptoHandles.cs
- EntityViewContainer.cs
- FormatVersion.cs
- DrawingContextDrawingContextWalker.cs
- TokenBasedSetEnumerator.cs
- ConnectionStringSettings.cs
- FileSecurity.cs
- RowToParametersTransformer.cs
- lengthconverter.cs
- SettingsBindableAttribute.cs
- WorkflowRuntime.cs
- WebPartDisplayMode.cs
- JsonReaderDelegator.cs
- XmlCharCheckingWriter.cs
- OdbcEnvironment.cs
- COM2FontConverter.cs
- TimeZone.cs
- ConfigurationProviderException.cs
- EventLogRecord.cs
- MenuItemCollection.cs
- CapacityStreamGeometryContext.cs
- AddToCollection.cs
- CollectionBuilder.cs
- ValidatorAttribute.cs
- IISUnsafeMethods.cs
- ObjectDataSource.cs
- TypedTableBaseExtensions.cs
- SmtpNetworkElement.cs
- UriTemplateDispatchFormatter.cs
- LambdaCompiler.Generated.cs
- Transactions.cs
- StringCollection.cs
- CopyNodeSetAction.cs
- FormsIdentity.cs
- DataExpression.cs
- CodeEntryPointMethod.cs
- EncryptedReference.cs
- DigestTraceRecordHelper.cs
- SpellerStatusTable.cs