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
- NonClientArea.cs
- DeviceFiltersSection.cs
- XmlSchemaSimpleType.cs
- CommandEventArgs.cs
- SchemaInfo.cs
- StateRuntime.cs
- CustomAssemblyResolver.cs
- ListViewItemMouseHoverEvent.cs
- GridViewColumnHeader.cs
- NodeFunctions.cs
- HwndKeyboardInputProvider.cs
- RegexCapture.cs
- UnrecognizedAssertionsBindingElement.cs
- TypeUsageBuilder.cs
- DataGridPageChangedEventArgs.cs
- SoundPlayer.cs
- XamlSerializationHelper.cs
- XamlPointCollectionSerializer.cs
- ServicePointManager.cs
- DesignerActionService.cs
- MetadataUtil.cs
- MimeMapping.cs
- ComponentEditorPage.cs
- XhtmlBasicListAdapter.cs
- MbpInfo.cs
- StopRoutingHandler.cs
- ConfigurationManagerInternal.cs
- ArgumentOutOfRangeException.cs
- MatrixAnimationUsingPath.cs
- ProtocolsConfigurationHandler.cs
- LicenseException.cs
- categoryentry.cs
- ModelTreeEnumerator.cs
- AppLevelCompilationSectionCache.cs
- UInt16Storage.cs
- WindowsMenu.cs
- HandleCollector.cs
- WebServiceReceive.cs
- SingleAnimationBase.cs
- WebPartConnection.cs
- WSSecurityPolicy11.cs
- EnumMember.cs
- CustomWebEventKey.cs
- InProcStateClientManager.cs
- XmlSchemaAny.cs
- MultitargetUtil.cs
- COM2ExtendedTypeConverter.cs
- NotifyIcon.cs
- ViewStateModeByIdAttribute.cs
- Condition.cs
- SqlUserDefinedTypeAttribute.cs
- ActivityXRefPropertyEditor.cs
- StartUpEventArgs.cs
- _CacheStreams.cs
- PrefixQName.cs
- ServiceDesigner.cs
- DependencyPropertyDescriptor.cs
- Operator.cs
- AttachmentCollection.cs
- DefaultValidator.cs
- XPathNavigator.cs
- TaskScheduler.cs
- ExitEventArgs.cs
- _PooledStream.cs
- WebScriptMetadataFormatter.cs
- ImageField.cs
- SplineQuaternionKeyFrame.cs
- RSACryptoServiceProvider.cs
- FieldDescriptor.cs
- File.cs
- EmptyStringExpandableObjectConverter.cs
- HttpGetClientProtocol.cs
- Color.cs
- FigureParaClient.cs
- ClientSideProviderDescription.cs
- XsltContext.cs
- storepermissionattribute.cs
- _NegoState.cs
- TabRenderer.cs
- ConfigurationLockCollection.cs
- LocalizabilityAttribute.cs
- ProxyWebPartConnectionCollection.cs
- AsymmetricKeyExchangeFormatter.cs
- BrowserCapabilitiesCodeGenerator.cs
- SqlDataSourceSelectingEventArgs.cs
- ComboBox.cs
- PerspectiveCamera.cs
- Region.cs
- BindStream.cs
- TimelineClockCollection.cs
- UnsignedPublishLicense.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- IxmlLineInfo.cs
- ModifierKeysValueSerializer.cs
- HttpFileCollectionBase.cs
- ImageUrlEditor.cs
- InputLanguage.cs
- AttachedPropertyBrowsableAttribute.cs
- ToolStripItemRenderEventArgs.cs
- Privilege.cs