Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataWeb / Client / System / Data / Services / Client / ALinq / ParameterReplacerVisitor.cs / 1305376 / 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.Diagnostics; using System.Linq.Expressions; ///Provides an expression visitor that can replace a internal class ParameterReplacerVisitor : ALinqExpressionVisitor { ///. 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
- InterleavedZipPartStream.cs
- SoapException.cs
- XmlSchemaCollection.cs
- Delegate.cs
- WebControl.cs
- TypefaceMap.cs
- AddingNewEventArgs.cs
- MessageAction.cs
- QueryGenerator.cs
- SemanticResultKey.cs
- ReceiveCompletedEventArgs.cs
- NonVisualControlAttribute.cs
- CodeGenerationManager.cs
- ApplicationProxyInternal.cs
- CodeDelegateCreateExpression.cs
- AssemblyName.cs
- ScriptHandlerFactory.cs
- XsltArgumentList.cs
- XmlQualifiedNameTest.cs
- SelectionPattern.cs
- Faults.cs
- OpCellTreeNode.cs
- Listener.cs
- BinaryCommonClasses.cs
- ScrollContentPresenter.cs
- RtfToken.cs
- MediaPlayer.cs
- EffectiveValueEntry.cs
- TransactionScopeDesigner.cs
- Visitor.cs
- ComplexBindingPropertiesAttribute.cs
- BooleanToVisibilityConverter.cs
- AccessText.cs
- SecurityContextKeyIdentifierClause.cs
- Avt.cs
- SelectingProviderEventArgs.cs
- ChangePassword.cs
- InheritanceContextChangedEventManager.cs
- DragEventArgs.cs
- ServiceDebugElement.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- BitmapMetadataEnumerator.cs
- RegexTree.cs
- ProfileGroupSettingsCollection.cs
- DefaultAsyncDataDispatcher.cs
- AccessibleObject.cs
- ExceptionHandlers.cs
- regiisutil.cs
- WindowsUpDown.cs
- ByteConverter.cs
- WindowsClaimSet.cs
- LinearGradientBrush.cs
- FileNameEditor.cs
- PageThemeCodeDomTreeGenerator.cs
- Path.cs
- LinqDataSourceStatusEventArgs.cs
- ConstNode.cs
- QueryStringParameter.cs
- XmlSerializerAssemblyAttribute.cs
- DataGridRow.cs
- EntityContainer.cs
- CommandSet.cs
- Internal.cs
- FilterableAttribute.cs
- TouchPoint.cs
- FileUtil.cs
- CodeTypeDeclaration.cs
- MetadataReference.cs
- ExceptionWrapper.cs
- AutomationEvent.cs
- HyperLinkColumn.cs
- PersonalizationState.cs
- EpmCustomContentDeSerializer.cs
- SystemTcpStatistics.cs
- DataSourceSelectArguments.cs
- FixedDocument.cs
- PageCache.cs
- PrintDialogDesigner.cs
- SqlDependencyListener.cs
- Bezier.cs
- ping.cs
- BitArray.cs
- TypeSystem.cs
- DrawingAttributeSerializer.cs
- SqlCommand.cs
- CodePageUtils.cs
- CodeMethodInvokeExpression.cs
- DbDataReader.cs
- ElementProxy.cs
- Comparer.cs
- Debugger.cs
- UTF8Encoding.cs
- HttpResponseHeader.cs
- NodeCounter.cs
- TextInfo.cs
- RulePatternOps.cs
- EndPoint.cs
- XmlSerializerFactory.cs
- CounterSet.cs
- CommandCollectionEditor.cs