Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- HttpListenerRequestUriBuilder.cs
- Soap12ProtocolReflector.cs
- SpStreamWrapper.cs
- ExceptionValidationRule.cs
- Viewport3DAutomationPeer.cs
- RewritingSimplifier.cs
- CallbackHandler.cs
- PropertyCollection.cs
- WebPartCollection.cs
- NativeMethods.cs
- StreamMarshaler.cs
- NativeBuffer.cs
- PaperSource.cs
- FullTextLine.cs
- DataGridViewTextBoxColumn.cs
- NavigateEvent.cs
- ActivityMarkupSerializer.cs
- UpdatePanelControlTrigger.cs
- SiteMapNodeCollection.cs
- ArithmeticException.cs
- CssClassPropertyAttribute.cs
- SoapConverter.cs
- XsltConvert.cs
- TraceHandler.cs
- ReferentialConstraint.cs
- DefaultTraceListener.cs
- FixedTextBuilder.cs
- CatalogZone.cs
- BaseResourcesBuildProvider.cs
- TypeGeneratedEventArgs.cs
- StaticExtension.cs
- RenderingBiasValidation.cs
- GridEntryCollection.cs
- UserControlAutomationPeer.cs
- Constants.cs
- ChangeDirector.cs
- XmlSchemas.cs
- SectionVisual.cs
- TextTabProperties.cs
- SQLDoubleStorage.cs
- TextEditorCharacters.cs
- InsufficientMemoryException.cs
- StylusEditingBehavior.cs
- LightweightCodeGenerator.cs
- CrossSiteScriptingValidation.cs
- XPathBinder.cs
- CompilerGlobalScopeAttribute.cs
- TcpServerChannel.cs
- DocumentSchemaValidator.cs
- TextEffect.cs
- SiteIdentityPermission.cs
- PackWebRequestFactory.cs
- AnnotationComponentChooser.cs
- Common.cs
- GeneralTransform2DTo3D.cs
- PartialArray.cs
- MappingMetadataHelper.cs
- ResourceManager.cs
- ResolveDuplexCD1AsyncResult.cs
- BindingCompleteEventArgs.cs
- Merger.cs
- GPRECT.cs
- SharedStatics.cs
- PolyBezierSegment.cs
- RuntimeConfigLKG.cs
- UnsafeMethods.cs
- GeneralTransform3D.cs
- OrderedEnumerableRowCollection.cs
- DirectoryInfo.cs
- HostingEnvironmentSection.cs
- VerificationAttribute.cs
- FileInfo.cs
- QuaternionAnimationBase.cs
- DataGridDesigner.cs
- ControlCollection.cs
- BufferBuilder.cs
- StringCollection.cs
- XPathDocumentNavigator.cs
- NotifyIcon.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- ImageCodecInfo.cs
- LocalFileSettingsProvider.cs
- CommonBehaviorsSection.cs
- MenuItemCollectionEditor.cs
- DataGridTable.cs
- DataControlFieldHeaderCell.cs
- CompositeDataBoundControl.cs
- QilUnary.cs
- MdiWindowListStrip.cs
- DiagnosticTrace.cs
- OleDbDataReader.cs
- TraceLevelHelper.cs
- IPipelineRuntime.cs
- EventItfInfo.cs
- WebPartVerb.cs
- _Semaphore.cs
- CreateUserWizardStep.cs
- LocatorGroup.cs
- MessageSecurityOverHttpElement.cs
- KnownTypesHelper.cs