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
- ToolstripProfessionalRenderer.cs
- TextMetrics.cs
- SqlUtils.cs
- InternalRelationshipCollection.cs
- ToolboxItemImageConverter.cs
- BufferModesCollection.cs
- ProxyGenerationError.cs
- RSACryptoServiceProvider.cs
- xamlnodes.cs
- HttpCachePolicy.cs
- ArcSegment.cs
- SymbolEqualComparer.cs
- ByteStack.cs
- LogExtentCollection.cs
- TableParagraph.cs
- keycontainerpermission.cs
- WinFormsSpinner.cs
- MatrixUtil.cs
- UIAgentInitializationException.cs
- SessionParameter.cs
- ClientScriptManagerWrapper.cs
- PropertyChangeTracker.cs
- ModelItemImpl.cs
- ProfilePropertyMetadata.cs
- ProxyGenerationError.cs
- InstanceData.cs
- QueryOperator.cs
- DocumentCollection.cs
- MouseEventArgs.cs
- graph.cs
- Region.cs
- MutexSecurity.cs
- SqlRetyper.cs
- TextParaLineResult.cs
- AssemblyHelper.cs
- ScriptReferenceEventArgs.cs
- ICspAsymmetricAlgorithm.cs
- TableLayout.cs
- ImageMapEventArgs.cs
- StrokeNode.cs
- SessionStateItemCollection.cs
- SQLDateTime.cs
- Main.cs
- COM2ExtendedUITypeEditor.cs
- PointCollectionConverter.cs
- AccessorTable.cs
- DataServices.cs
- UInt16Converter.cs
- SystemColors.cs
- StreamResourceInfo.cs
- PerspectiveCamera.cs
- CalculatedColumn.cs
- RIPEMD160.cs
- XmlQueryOutput.cs
- FragmentQueryKB.cs
- SetMemberBinder.cs
- FileDialog_Vista.cs
- GridViewPageEventArgs.cs
- ToolStripRendererSwitcher.cs
- FileDetails.cs
- DataControlPagerLinkButton.cs
- UTF32Encoding.cs
- SqlCacheDependencySection.cs
- WebPartConnectionsDisconnectVerb.cs
- KeyInterop.cs
- DesignColumnCollection.cs
- Message.cs
- SystemColorTracker.cs
- ActivationServices.cs
- TransformProviderWrapper.cs
- BasicKeyConstraint.cs
- PDBReader.cs
- GenerateTemporaryAssemblyTask.cs
- CLRBindingWorker.cs
- StorageSetMapping.cs
- CompilationUtil.cs
- ScriptingSectionGroup.cs
- XmlSerializationGeneratedCode.cs
- Profiler.cs
- Button.cs
- DesignTimeHTMLTextWriter.cs
- RemoteCryptoTokenProvider.cs
- ClientTarget.cs
- AppSettings.cs
- IDispatchConstantAttribute.cs
- ClusterRegistryConfigurationProvider.cs
- XpsS0ValidatingLoader.cs
- SqlProviderManifest.cs
- ClientTargetSection.cs
- RawAppCommandInputReport.cs
- LinqDataSourceHelper.cs
- RegexCaptureCollection.cs
- DateTimeOffset.cs
- LinkLabelLinkClickedEvent.cs
- DateTimeEditor.cs
- Vector3DAnimation.cs
- ListBox.cs
- ImmutableObjectAttribute.cs
- WebDisplayNameAttribute.cs
- RIPEMD160.cs