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
- AddInControllerImpl.cs
- GridToolTip.cs
- BaseCollection.cs
- XmlHierarchyData.cs
- TextProperties.cs
- TransportBindingElementImporter.cs
- PageContentAsyncResult.cs
- StatusBarPanel.cs
- RepeatEnumerable.cs
- WebMessageEncodingElement.cs
- WindowsIPAddress.cs
- DataGridColumn.cs
- SR.cs
- ServicePointManager.cs
- Comparer.cs
- SoapServerMethod.cs
- BinaryObjectWriter.cs
- Rotation3D.cs
- HtmlElementCollection.cs
- ReadOnlyDataSourceView.cs
- InstanceNormalEvent.cs
- DropShadowEffect.cs
- CodeAccessPermission.cs
- BitmapFrameEncode.cs
- VerificationAttribute.cs
- NotifyIcon.cs
- RequestCachePolicyConverter.cs
- _AutoWebProxyScriptWrapper.cs
- SQLDecimalStorage.cs
- SqlNamer.cs
- RootBrowserWindowAutomationPeer.cs
- PixelShader.cs
- DesignTimeTemplateParser.cs
- WebControlAdapter.cs
- ListBoxChrome.cs
- SmtpClient.cs
- DataMisalignedException.cs
- RayMeshGeometry3DHitTestResult.cs
- RegexInterpreter.cs
- MobileControlBuilder.cs
- ToolTipAutomationPeer.cs
- ProcessModule.cs
- NativeMethods.cs
- IntAverageAggregationOperator.cs
- EventProperty.cs
- ProfileParameter.cs
- DependencyPropertyDescriptor.cs
- PropertyOverridesDialog.cs
- ApplicationFileParser.cs
- ToggleButton.cs
- Icon.cs
- RightsDocument.cs
- recordstatefactory.cs
- HtmlLabelAdapter.cs
- StringPropertyBuilder.cs
- ZipIOCentralDirectoryBlock.cs
- KeyNotFoundException.cs
- HttpMethodAttribute.cs
- LiteralTextContainerControlBuilder.cs
- RouteItem.cs
- RegularExpressionValidator.cs
- TransformationRules.cs
- ToolStripRenderer.cs
- AssemblyAttributesGoHere.cs
- SHA256Cng.cs
- MsmqIntegrationOutputChannel.cs
- MachineKeySection.cs
- SqlDataSourceRefreshSchemaForm.cs
- BitmapDownload.cs
- oledbconnectionstring.cs
- GridItem.cs
- BamlTreeMap.cs
- SessionStateContainer.cs
- ScriptControlManager.cs
- AttributeCollection.cs
- PingOptions.cs
- LogPolicy.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- FlowDecisionLabelFeature.cs
- TypedRowHandler.cs
- CapabilitiesAssignment.cs
- Types.cs
- PartManifestEntry.cs
- PropertyIdentifier.cs
- SessionParameter.cs
- ListControlActionList.cs
- DateTimeOffset.cs
- ZipIOExtraFieldElement.cs
- GridPattern.cs
- DataDocumentXPathNavigator.cs
- FieldBuilder.cs
- Evidence.cs
- ScriptServiceAttribute.cs
- ContextMarshalException.cs
- CqlErrorHelper.cs
- FrameAutomationPeer.cs
- CachedPathData.cs
- HttpMethodAttribute.cs
- Model3D.cs
- Console.cs