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
- WpfKnownMemberInvoker.cs
- IdentityHolder.cs
- ExpressionDumper.cs
- _ProxyChain.cs
- TableLayoutSettings.cs
- ModelMemberCollection.cs
- KnownIds.cs
- DBDataPermissionAttribute.cs
- HtmlTableCell.cs
- Crc32.cs
- Helper.cs
- MobileTemplatedControlDesigner.cs
- Command.cs
- DataGridAutomationPeer.cs
- MembershipAdapter.cs
- RightsManagementSuppressedStream.cs
- HotSpotCollection.cs
- FormViewCommandEventArgs.cs
- XmlElementList.cs
- XamlToRtfParser.cs
- DocumentPageViewAutomationPeer.cs
- ISAPIRuntime.cs
- File.cs
- CmsUtils.cs
- DataListItemCollection.cs
- QueryProcessor.cs
- Utils.cs
- DataListGeneralPage.cs
- CodeStatement.cs
- ProfileEventArgs.cs
- MetabaseSettingsIis7.cs
- ExtentKey.cs
- AssemblyName.cs
- PassportPrincipal.cs
- LogEntryUtils.cs
- Propagator.Evaluator.cs
- VectorCollectionConverter.cs
- XNodeNavigator.cs
- CodeAttributeArgument.cs
- GeometryCollection.cs
- DesignerProperties.cs
- Pair.cs
- StoreContentChangedEventArgs.cs
- PlatformNotSupportedException.cs
- TransformPattern.cs
- GACIdentityPermission.cs
- MailWebEventProvider.cs
- StructuredProperty.cs
- ColorContext.cs
- selecteditemcollection.cs
- SessionViewState.cs
- PageAsyncTaskManager.cs
- Literal.cs
- TextRunTypographyProperties.cs
- RectKeyFrameCollection.cs
- NotEqual.cs
- GeneratedCodeAttribute.cs
- FixUp.cs
- WinEventQueueItem.cs
- InheritanceService.cs
- WindowsPrincipal.cs
- ResourceExpressionBuilder.cs
- TextPointer.cs
- Splitter.cs
- Attributes.cs
- HwndHostAutomationPeer.cs
- _IPv6Address.cs
- MILUtilities.cs
- HtmlTitle.cs
- XXXOnTypeBuilderInstantiation.cs
- TemplateControlBuildProvider.cs
- IDQuery.cs
- Claim.cs
- DynamicHyperLink.cs
- RepeaterItemEventArgs.cs
- SQLGuid.cs
- EarlyBoundInfo.cs
- PropertyGroupDescription.cs
- DataGridViewTextBoxEditingControl.cs
- SchemaLookupTable.cs
- Transactions.cs
- IndentedWriter.cs
- ViewValidator.cs
- SystemEvents.cs
- TriState.cs
- DataGridViewButtonColumn.cs
- IntegerValidator.cs
- QuaternionRotation3D.cs
- UTF7Encoding.cs
- SimpleHandlerBuildProvider.cs
- NeutralResourcesLanguageAttribute.cs
- FileSystemEventArgs.cs
- Validator.cs
- FormViewDeleteEventArgs.cs
- CopyAction.cs
- SerializationHelper.cs
- Bitmap.cs
- XamlClipboardData.cs
- OAVariantLib.cs
- HttpConfigurationSystem.cs