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
- IDataContractSurrogate.cs
- HoistedLocals.cs
- SqlTriggerAttribute.cs
- LogicalTreeHelper.cs
- XmlObjectSerializerReadContextComplex.cs
- WebPartTransformerAttribute.cs
- DBSchemaRow.cs
- EDesignUtil.cs
- WindowsScroll.cs
- MethodImplAttribute.cs
- ProfileInfo.cs
- EvidenceBase.cs
- SharedStatics.cs
- TdsParameterSetter.cs
- ReflectionServiceProvider.cs
- LinqDataSourceHelper.cs
- _ShellExpression.cs
- MenuAdapter.cs
- IntranetCredentialPolicy.cs
- UnknownBitmapEncoder.cs
- WsdlParser.cs
- FormParameter.cs
- HMACRIPEMD160.cs
- PenContexts.cs
- HttpNamespaceReservationInstallComponent.cs
- Propagator.cs
- ServicesUtilities.cs
- Pkcs9Attribute.cs
- CheckBoxRenderer.cs
- EditorPartChrome.cs
- ModelService.cs
- SByteConverter.cs
- RequestCacheManager.cs
- XmlBindingWorker.cs
- ModifierKeysValueSerializer.cs
- XmlSerializer.cs
- Ray3DHitTestResult.cs
- TraceProvider.cs
- SoapBinding.cs
- SwitchAttribute.cs
- VirtualPathUtility.cs
- PolicyLevel.cs
- CookieParameter.cs
- GridItemCollection.cs
- StateMachine.cs
- SortQuery.cs
- DateTimeSerializationSection.cs
- UrlAuthFailedErrorFormatter.cs
- AutomationPropertyInfo.cs
- QueryOutputWriter.cs
- ProtocolsConfigurationHandler.cs
- CompositionAdorner.cs
- SQLBoolean.cs
- SoapInteropTypes.cs
- ClientSettingsProvider.cs
- WebServiceReceive.cs
- RecordBuilder.cs
- ColorDialog.cs
- PackageDigitalSignature.cs
- XmlSchemaInferenceException.cs
- XmlSchemaImporter.cs
- CreatingCookieEventArgs.cs
- UnsafePeerToPeerMethods.cs
- ObsoleteAttribute.cs
- FaultContractInfo.cs
- HtmlInputImage.cs
- FocusWithinProperty.cs
- dbdatarecord.cs
- ChangeDirector.cs
- HttpClientCertificate.cs
- WebControl.cs
- DataService.cs
- XmlHierarchicalDataSourceView.cs
- JsonSerializer.cs
- RadioButton.cs
- PanelStyle.cs
- TextFindEngine.cs
- DynamicDataResources.Designer.cs
- CompositeControl.cs
- _OSSOCK.cs
- EntityKeyElement.cs
- ExpressionBuilderCollection.cs
- FolderNameEditor.cs
- WindowsTab.cs
- MD5.cs
- LocalizationComments.cs
- DiscoveryClientProtocol.cs
- IntegerValidator.cs
- ToolZone.cs
- FixedBufferAttribute.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- RtType.cs
- SqlDataSource.cs
- CapabilitiesUse.cs
- XmlStringTable.cs
- BlobPersonalizationState.cs
- UpDownBase.cs
- DoubleStorage.cs
- sqlser.cs
- CultureInfoConverter.cs