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
- ProtocolInformationReader.cs
- ObjectDataSourceFilteringEventArgs.cs
- AttributeEmitter.cs
- ProcessHostConfigUtils.cs
- OutgoingWebResponseContext.cs
- Clock.cs
- MenuScrollingVisibilityConverter.cs
- WebWorkflowRole.cs
- DecoderNLS.cs
- ImageFormatConverter.cs
- QilTargetType.cs
- PreviewPageInfo.cs
- LassoHelper.cs
- X509WindowsSecurityToken.cs
- BitHelper.cs
- ConsoleCancelEventArgs.cs
- SafeFileMapViewHandle.cs
- CancelEventArgs.cs
- StatusBarAutomationPeer.cs
- EndPoint.cs
- DefaultEventAttribute.cs
- Button.cs
- PageThemeParser.cs
- AttributeQuery.cs
- DesignerForm.cs
- DataGridViewCellPaintingEventArgs.cs
- ReflectionUtil.cs
- XmlNavigatorStack.cs
- ReadOnlyObservableCollection.cs
- WebConfigurationHost.cs
- GenerateScriptTypeAttribute.cs
- baseaxisquery.cs
- OdbcConnectionOpen.cs
- DbTransaction.cs
- StandardCommands.cs
- Function.cs
- FlatButtonAppearance.cs
- DirectoryInfo.cs
- CurrencyManager.cs
- TypeEnumerableViewSchema.cs
- ChannelDispatcherBase.cs
- ValidationEventArgs.cs
- PeerChannelFactory.cs
- DebugController.cs
- TreeViewItemAutomationPeer.cs
- AutomationPatternInfo.cs
- FlowLayoutPanelDesigner.cs
- CompositeControl.cs
- TypeDescriptorContext.cs
- Visual3DCollection.cs
- MemberExpression.cs
- InvalidCastException.cs
- DoWorkEventArgs.cs
- WebControlToolBoxItem.cs
- CapabilitiesSection.cs
- MetadataProperty.cs
- ExpressionEditorSheet.cs
- UnregisterInfo.cs
- JsonObjectDataContract.cs
- UnwrappedTypesXmlSerializerManager.cs
- ZoneLinkButton.cs
- Style.cs
- SqlDataSourceCommandEventArgs.cs
- SQLInt64Storage.cs
- Parser.cs
- RichTextBox.cs
- XmlDataCollection.cs
- AtomParser.cs
- CompilerHelpers.cs
- basevalidator.cs
- CacheHelper.cs
- InkCanvas.cs
- WebPageTraceListener.cs
- ToolboxItemFilterAttribute.cs
- SQLChars.cs
- Cursors.cs
- TableProvider.cs
- ProjectionPlanCompiler.cs
- TreeView.cs
- BlurEffect.cs
- SystemResourceKey.cs
- DataGridViewImageColumn.cs
- DesignerOptionService.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- TextDecoration.cs
- HtmlInputHidden.cs
- ActiveXContainer.cs
- ComboBox.cs
- SortKey.cs
- ScriptReferenceEventArgs.cs
- XPathDescendantIterator.cs
- FunctionDetailsReader.cs
- RequestCachingSection.cs
- MenuScrollingVisibilityConverter.cs
- ConfigPathUtility.cs
- PermissionAttributes.cs
- TableProviderWrapper.cs
- IDispatchConstantAttribute.cs
- MenuItem.cs
- codemethodreferenceexpression.cs