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
- ParserOptions.cs
- HtmlInputSubmit.cs
- Vector3DAnimationBase.cs
- ReadOnlyMetadataCollection.cs
- ServicePointManagerElement.cs
- ResolvedKeyFrameEntry.cs
- AncestorChangedEventArgs.cs
- XPathSelfQuery.cs
- ComPlusAuthorization.cs
- DashStyle.cs
- OlePropertyStructs.cs
- PingReply.cs
- Misc.cs
- FormViewRow.cs
- ProcessDesigner.cs
- ThicknessKeyFrameCollection.cs
- OdbcUtils.cs
- HandleScope.cs
- SqlProvider.cs
- Section.cs
- EdgeModeValidation.cs
- ServiceBuildProvider.cs
- DataGridView.cs
- SqlNotificationEventArgs.cs
- Table.cs
- BindingGroup.cs
- Compensate.cs
- EditorAttribute.cs
- CommonDialog.cs
- NonParentingControl.cs
- ScriptingWebServicesSectionGroup.cs
- HashMembershipCondition.cs
- Point.cs
- XmlCompatibilityReader.cs
- SystemFonts.cs
- ReceiveParametersContent.cs
- ApplicationDirectoryMembershipCondition.cs
- VariableQuery.cs
- BitmapPalettes.cs
- OleDbSchemaGuid.cs
- ToolStripDropDownClosingEventArgs.cs
- Matrix.cs
- Collection.cs
- SecurityIdentifierConverter.cs
- EntitySqlQueryBuilder.cs
- basecomparevalidator.cs
- DynamicILGenerator.cs
- Profiler.cs
- Point3DAnimation.cs
- XDRSchema.cs
- ViewStateException.cs
- X509Utils.cs
- OLEDB_Enum.cs
- XdrBuilder.cs
- LongValidator.cs
- webeventbuffer.cs
- ServicePerformanceCounters.cs
- TaskFormBase.cs
- EntityCommand.cs
- SymbolEqualComparer.cs
- Thread.cs
- OpCopier.cs
- ColumnBinding.cs
- FillErrorEventArgs.cs
- ScriptResourceInfo.cs
- ObjectViewEntityCollectionData.cs
- MatchingStyle.cs
- UDPClient.cs
- CachedRequestParams.cs
- securestring.cs
- XamlDesignerSerializationManager.cs
- CodeIndexerExpression.cs
- XmlConvert.cs
- RuntimeConfigLKG.cs
- CatalogPartCollection.cs
- ResXBuildProvider.cs
- NativeMethods.cs
- SqlStream.cs
- SeverityFilter.cs
- SQLBytesStorage.cs
- BuildProviderAppliesToAttribute.cs
- SafeThemeHandle.cs
- MouseEventArgs.cs
- StringUtil.cs
- XmlSchemaSearchPattern.cs
- EncoderBestFitFallback.cs
- CharEnumerator.cs
- AnimatedTypeHelpers.cs
- CorrelationScope.cs
- StateItem.cs
- ListBoxItem.cs
- Console.cs
- HttpHeaderCollection.cs
- QueryOutputWriter.cs
- OrderedHashRepartitionStream.cs
- RouteParameter.cs
- IPAddress.cs
- RefreshPropertiesAttribute.cs
- TextContainer.cs
- SmtpMail.cs