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
- XDRSchema.cs
- SiteMapSection.cs
- ElementUtil.cs
- OrderByBuilder.cs
- FlowDocumentFormatter.cs
- Repeater.cs
- MetafileHeaderWmf.cs
- HtmlTableCell.cs
- FilteredXmlReader.cs
- DataGridViewCellStyleChangedEventArgs.cs
- SecurityRuntime.cs
- WebPartMinimizeVerb.cs
- ToolStripItemRenderEventArgs.cs
- NonClientArea.cs
- PageRanges.cs
- RolePrincipal.cs
- XmlUtf8RawTextWriter.cs
- ScrollViewerAutomationPeer.cs
- ProcessHostMapPath.cs
- InkCanvasFeedbackAdorner.cs
- LostFocusEventManager.cs
- MsmqIntegrationReceiveParameters.cs
- ParallelForEach.cs
- TemplateControlBuildProvider.cs
- SingleResultAttribute.cs
- IdentitySection.cs
- EventProxy.cs
- iisPickupDirectory.cs
- ValidatedControlConverter.cs
- FilterInvalidBodyAccessException.cs
- CompilerWrapper.cs
- DataGridCaption.cs
- BulletDecorator.cs
- __Filters.cs
- XmlUtilWriter.cs
- DocumentPage.cs
- LineGeometry.cs
- PieceNameHelper.cs
- CombinedTcpChannel.cs
- GPPOINT.cs
- Point3DCollection.cs
- _ListenerResponseStream.cs
- TemplateAction.cs
- Inflater.cs
- ZipIORawDataFileBlock.cs
- XmlSubtreeReader.cs
- DataColumnPropertyDescriptor.cs
- PersistenceProviderBehavior.cs
- TextInfo.cs
- PackageRelationshipCollection.cs
- Odbc32.cs
- ValueTypePropertyReference.cs
- SkipStoryboardToFill.cs
- SerializationSectionGroup.cs
- PropertyPathWorker.cs
- AudioFileOut.cs
- SwitchLevelAttribute.cs
- XmlReaderSettings.cs
- AbstractExpressions.cs
- XsdValidatingReader.cs
- MarkupExtensionParser.cs
- OleDbPropertySetGuid.cs
- IndentedWriter.cs
- Vector3DAnimation.cs
- IntSecurity.cs
- ImageIndexConverter.cs
- MaskedTextBoxTextEditor.cs
- MarginCollapsingState.cs
- DataGridViewMethods.cs
- Transactions.cs
- ExeConfigurationFileMap.cs
- MissingMemberException.cs
- SoapMessage.cs
- ActiveXHelper.cs
- ControlAdapter.cs
- DistinctQueryOperator.cs
- GenericEnumConverter.cs
- HitTestResult.cs
- OutputCacheModule.cs
- MinMaxParagraphWidth.cs
- WindowsFormsSectionHandler.cs
- PersonalizablePropertyEntry.cs
- PointKeyFrameCollection.cs
- ObjectDataProvider.cs
- NativeCppClassAttribute.cs
- CodeDirectoryCompiler.cs
- NativeMethods.cs
- Guid.cs
- ServiceActivationException.cs
- RangeExpression.cs
- SHA512Managed.cs
- EntityParameterCollection.cs
- StrongTypingException.cs
- ScriptComponentDescriptor.cs
- CanonicalXml.cs
- HandlerBase.cs
- BooleanExpr.cs
- RemoteWebConfigurationHostStream.cs
- HtmlTextArea.cs
- BitmapEncoder.cs