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
- FormsAuthenticationModule.cs
- DataRowComparer.cs
- WebDisplayNameAttribute.cs
- AssemblyResolver.cs
- DataColumnMapping.cs
- TextBoxBase.cs
- VectorKeyFrameCollection.cs
- EditorBrowsableAttribute.cs
- Action.cs
- PageEventArgs.cs
- EndPoint.cs
- SqlDataSourceView.cs
- XmlNamespaceManager.cs
- FileDetails.cs
- StrongTypingException.cs
- PropertyState.cs
- SQLInt16Storage.cs
- MachineKeySection.cs
- ZoneButton.cs
- XmlILModule.cs
- EntityCommandExecutionException.cs
- TextPointer.cs
- SqlTransaction.cs
- ApplicationDirectory.cs
- MatrixCamera.cs
- XmlMtomReader.cs
- QuaternionValueSerializer.cs
- GeometryGroup.cs
- PolicyStatement.cs
- _LocalDataStoreMgr.cs
- GroupDescription.cs
- NativeWindow.cs
- NetSectionGroup.cs
- FontStyleConverter.cs
- SqlServer2KCompatibilityCheck.cs
- KeyValueInternalCollection.cs
- OdbcUtils.cs
- GetWinFXPath.cs
- DataGridRowHeaderAutomationPeer.cs
- ItemsControlAutomationPeer.cs
- XamlReaderHelper.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- TargetException.cs
- EditBehavior.cs
- ContentFileHelper.cs
- ControlParameter.cs
- CheckBox.cs
- StringComparer.cs
- OperandQuery.cs
- RegexCapture.cs
- GroupBoxRenderer.cs
- BatchStream.cs
- DisableDpiAwarenessAttribute.cs
- EnvironmentPermission.cs
- OleDbRowUpdatingEvent.cs
- Scripts.cs
- ChannelFactoryRefCache.cs
- SystemTcpStatistics.cs
- UrlPath.cs
- XmlName.cs
- EventSetter.cs
- CommentEmitter.cs
- PrintDialogException.cs
- AsymmetricKeyExchangeFormatter.cs
- TextRange.cs
- NavigationPropertySingletonExpression.cs
- SqlProfileProvider.cs
- BindableTemplateBuilder.cs
- XmlEntity.cs
- TextFindEngine.cs
- BackgroundWorker.cs
- JoinGraph.cs
- OneOf.cs
- ChangeNode.cs
- TreeNodeBindingCollection.cs
- input.cs
- StrokeFIndices.cs
- Timer.cs
- BackgroundWorker.cs
- HTTPNotFoundHandler.cs
- CopyOnWriteList.cs
- BCryptHashAlgorithm.cs
- JournalEntry.cs
- WriterOutput.cs
- SingleSelectRootGridEntry.cs
- SeverityFilter.cs
- ListControlDesigner.cs
- Parser.cs
- SystemWebCachingSectionGroup.cs
- XamlVector3DCollectionSerializer.cs
- PermissionSetEnumerator.cs
- ThemeInfoAttribute.cs
- AppDomainFactory.cs
- WebPartTracker.cs
- Brush.cs
- XPathNavigator.cs
- MultiplexingDispatchMessageFormatter.cs
- OptionalColumn.cs
- TemplateControl.cs
- Int32EqualityComparer.cs