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
- ConnectivityStatus.cs
- OleDbTransaction.cs
- RangeValidator.cs
- WindowVisualStateTracker.cs
- DirectoryObjectSecurity.cs
- Route.cs
- UInt64Storage.cs
- DefaultEventAttribute.cs
- TraceHandlerErrorFormatter.cs
- DBCSCodePageEncoding.cs
- DbReferenceCollection.cs
- TypeInfo.cs
- Grant.cs
- AdvancedBindingPropertyDescriptor.cs
- PropertyTab.cs
- AuthorizationRule.cs
- XmlAtomicValue.cs
- PowerStatus.cs
- AnimationLayer.cs
- DbXmlEnabledProviderManifest.cs
- BuildProvidersCompiler.cs
- SqlDataReader.cs
- WeakReference.cs
- CompModSwitches.cs
- CapabilitiesAssignment.cs
- OSFeature.cs
- XmlNavigatorStack.cs
- HttpApplicationFactory.cs
- StringHelper.cs
- WebPartEditorOkVerb.cs
- SelectionRange.cs
- ValidationRule.cs
- ParameterExpression.cs
- ExtensionFile.cs
- ConfigXmlAttribute.cs
- ItemsPresenter.cs
- StylusPointCollection.cs
- ScriptControlManager.cs
- StringKeyFrameCollection.cs
- BindingMAnagerBase.cs
- PolicyVersionConverter.cs
- FileStream.cs
- XmlAtomicValue.cs
- AuthenticateEventArgs.cs
- UpdatePanel.cs
- DataControlImageButton.cs
- StaticResourceExtension.cs
- XamlWriter.cs
- TrackingMemoryStreamFactory.cs
- ResourcePool.cs
- CookieProtection.cs
- Border.cs
- Span.cs
- CharUnicodeInfo.cs
- InvokeHandlers.cs
- GridViewColumnHeader.cs
- ListenerChannelContext.cs
- InternalResources.cs
- FileUtil.cs
- SQLInt16.cs
- InputChannelAcceptor.cs
- AdvancedBindingEditor.cs
- FormViewDeletedEventArgs.cs
- XmlValueConverter.cs
- ItemContainerProviderWrapper.cs
- ErrorView.xaml.cs
- SafeFileMappingHandle.cs
- AsyncOperationManager.cs
- CompoundFileStorageReference.cs
- NetworkInformationPermission.cs
- ExchangeUtilities.cs
- CorrelationRequestContext.cs
- coordinator.cs
- DocComment.cs
- MessageAction.cs
- InstalledVoice.cs
- XsdDuration.cs
- TogglePatternIdentifiers.cs
- FileNotFoundException.cs
- SizeAnimationBase.cs
- designeractionbehavior.cs
- PersonalizablePropertyEntry.cs
- CompressionTransform.cs
- RangeValidator.cs
- GridProviderWrapper.cs
- AlignmentXValidation.cs
- LongSumAggregationOperator.cs
- WmfPlaceableFileHeader.cs
- OracleConnection.cs
- RelationshipConverter.cs
- WmpBitmapDecoder.cs
- MarshalByRefObject.cs
- CustomTypeDescriptor.cs
- DecimalAnimationUsingKeyFrames.cs
- DbProviderFactoriesConfigurationHandler.cs
- Walker.cs
- ProcessInputEventArgs.cs
- RenameRuleObjectDialog.cs
- TextProperties.cs
- SubstitutionList.cs