Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / ndp / fx / src / DataWeb / Client / System / Data / Services / Client / ALinq / ParameterReplacerVisitor.cs / 1 / ParameterReplacerVisitor.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // //// Provides an expression visitor that can replace a ParameterExpression. // // // @owner [....], [....] //--------------------------------------------------------------------- namespace System.Data.Services.Client { using System; using System.Collections.Generic; using System.Linq.Expressions; using System.Diagnostics; ///Provides an expression visitor that can replace a internal class ParameterReplacerVisitor : ExpressionVisitor { ///. Expression to replace with. private Expression newExpression; ///Parameter to replace. private ParameterExpression oldParameter; ///Initializes a new /// Parameter to replace. /// Expression to replace with. private ParameterReplacerVisitor(ParameterExpression oldParameter, Expression newExpression) { this.oldParameter = oldParameter; this.newExpression = newExpression; } ///instance. /// Replaces the occurences of /// Expression to perform replacement on. /// Parameter to replace. /// Expression to replace with. ///for in /// . /// A new expression with the replacement performed. internal static Expression Replace(Expression expression, ParameterExpression oldParameter, Expression newExpression) { Debug.Assert(expression != null, "expression != null"); Debug.Assert(oldParameter != null, "oldParameter != null"); Debug.Assert(newExpression != null, "newExpression != null"); return new ParameterReplacerVisitor(oldParameter, newExpression).Visit(expression); } ///ParameterExpression visit method. /// The ParameterExpression expression to visit ///The visited ParameterExpression expression internal override Expression VisitParameter(ParameterExpression p) { if (p == this.oldParameter) { return this.newExpression; } else { return p; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // //// Provides an expression visitor that can replace a ParameterExpression. // // // @owner [....], [....] //--------------------------------------------------------------------- namespace System.Data.Services.Client { using System; using System.Collections.Generic; using System.Linq.Expressions; using System.Diagnostics; ///Provides an expression visitor that can replace a internal class ParameterReplacerVisitor : ExpressionVisitor { ///. Expression to replace with. private Expression newExpression; ///Parameter to replace. private ParameterExpression oldParameter; ///Initializes a new /// Parameter to replace. /// Expression to replace with. private ParameterReplacerVisitor(ParameterExpression oldParameter, Expression newExpression) { this.oldParameter = oldParameter; this.newExpression = newExpression; } ///instance. /// Replaces the occurences of /// Expression to perform replacement on. /// Parameter to replace. /// Expression to replace with. ///for in /// . /// A new expression with the replacement performed. internal static Expression Replace(Expression expression, ParameterExpression oldParameter, Expression newExpression) { Debug.Assert(expression != null, "expression != null"); Debug.Assert(oldParameter != null, "oldParameter != null"); Debug.Assert(newExpression != null, "newExpression != null"); return new ParameterReplacerVisitor(oldParameter, newExpression).Visit(expression); } ///ParameterExpression visit method. /// The ParameterExpression expression to visit ///The visited ParameterExpression expression internal override Expression VisitParameter(ParameterExpression p) { if (p == this.oldParameter) { return this.newExpression; } else { return p; } } } } // 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
- ImageSourceValueSerializer.cs
- ColumnWidthChangingEvent.cs
- DataGridViewCellEventArgs.cs
- Binding.cs
- NextPreviousPagerField.cs
- PagerStyle.cs
- Exceptions.cs
- UserControlCodeDomTreeGenerator.cs
- _AutoWebProxyScriptWrapper.cs
- ChtmlSelectionListAdapter.cs
- XmlIncludeAttribute.cs
- Rules.cs
- WaitHandleCannotBeOpenedException.cs
- ConfigurationManagerInternalFactory.cs
- IndependentAnimationStorage.cs
- CollectionViewGroupRoot.cs
- MissingSatelliteAssemblyException.cs
- StringCollection.cs
- MenuItemStyleCollection.cs
- DoubleUtil.cs
- FormsAuthenticationUserCollection.cs
- WindowsToolbarItemAsMenuItem.cs
- ContentValidator.cs
- HttpHandlerActionCollection.cs
- DataGridCell.cs
- PageAsyncTask.cs
- OuterGlowBitmapEffect.cs
- TextRangeAdaptor.cs
- SessionEndingEventArgs.cs
- ConstrainedDataObject.cs
- SoundPlayerAction.cs
- RawKeyboardInputReport.cs
- OpacityConverter.cs
- StylusCaptureWithinProperty.cs
- UserControlBuildProvider.cs
- CacheMemory.cs
- FileLevelControlBuilderAttribute.cs
- AmbientLight.cs
- ProviderIncompatibleException.cs
- CacheOutputQuery.cs
- ResourceDefaultValueAttribute.cs
- Exceptions.cs
- SqlConnectionFactory.cs
- GroupedContextMenuStrip.cs
- PropertyOverridesDialog.cs
- BlurEffect.cs
- Rotation3D.cs
- ThumbAutomationPeer.cs
- DoubleLinkListEnumerator.cs
- DispatcherHooks.cs
- MailDefinition.cs
- TypeValidationEventArgs.cs
- Effect.cs
- FixedFindEngine.cs
- Unit.cs
- ThreadExceptionDialog.cs
- DataControlFieldCollection.cs
- TextBox.cs
- MailDefinition.cs
- PositiveTimeSpanValidator.cs
- Int64.cs
- CornerRadiusConverter.cs
- XmlILIndex.cs
- RSAPKCS1SignatureDeformatter.cs
- HtmlWindow.cs
- WorkflowMarkupSerializer.cs
- OracleException.cs
- Repeater.cs
- ByteKeyFrameCollection.cs
- COM2ComponentEditor.cs
- ActivityExecutorDelegateInfo.cs
- EdmComplexPropertyAttribute.cs
- XmlSchemaProviderAttribute.cs
- FixedTextBuilder.cs
- Mappings.cs
- GPStream.cs
- RegexNode.cs
- AutomationEventArgs.cs
- RegisteredHiddenField.cs
- PropertyInfoSet.cs
- SmiEventStream.cs
- TrustLevel.cs
- RightsManagementInformation.cs
- RowsCopiedEventArgs.cs
- X509SecurityTokenParameters.cs
- ArraySubsetEnumerator.cs
- RepeatButtonAutomationPeer.cs
- Processor.cs
- MSAAWinEventWrap.cs
- CommandDevice.cs
- PathSegmentCollection.cs
- DateTimeOffset.cs
- RegistryKey.cs
- TextInfo.cs
- ResourceAttributes.cs
- ValueSerializerAttribute.cs
- SystemFonts.cs
- ProcessHostServerConfig.cs
- SessionStateSection.cs
- MissingMethodException.cs