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
- TreeViewHitTestInfo.cs
- TdsParserStateObject.cs
- WindowVisualStateTracker.cs
- DependencyObjectType.cs
- FixedSOMPageElement.cs
- IMembershipProvider.cs
- MsmqReceiveHelper.cs
- RelationshipFixer.cs
- SqlUdtInfo.cs
- HttpPostedFile.cs
- FieldToken.cs
- DocumentOrderComparer.cs
- Transform3DGroup.cs
- SafeNativeMethods.cs
- AutomationPatternInfo.cs
- basecomparevalidator.cs
- EnumerableWrapperWeakToStrong.cs
- BStrWrapper.cs
- EventLogger.cs
- SortKey.cs
- SafeNativeMethods.cs
- Calendar.cs
- TextParagraphProperties.cs
- DragStartedEventArgs.cs
- XmlTextAttribute.cs
- OLEDB_Enum.cs
- ModelTypeConverter.cs
- GridViewUpdatedEventArgs.cs
- NativeMethods.cs
- ServerValidateEventArgs.cs
- TextElementCollectionHelper.cs
- OutputCacheSection.cs
- _NTAuthentication.cs
- PrintPageEvent.cs
- ExpressionPrefixAttribute.cs
- sqlinternaltransaction.cs
- SymbolType.cs
- HostExecutionContextManager.cs
- TimersDescriptionAttribute.cs
- RsaSecurityTokenAuthenticator.cs
- BamlLocalizableResourceKey.cs
- OperationAbortedException.cs
- EntityStoreSchemaGenerator.cs
- DynamicRenderer.cs
- WorkflowView.cs
- ColumnClickEvent.cs
- TrackingServices.cs
- Activity.cs
- WebSysDescriptionAttribute.cs
- StrongNameKeyPair.cs
- DataGridViewCellCancelEventArgs.cs
- ChtmlCalendarAdapter.cs
- PropertyGeneratedEventArgs.cs
- ActivityExecutionContextCollection.cs
- SystemBrushes.cs
- MenuItemBinding.cs
- TableRow.cs
- DataGridColumnHeadersPresenterAutomationPeer.cs
- XmlSchemaSimpleContent.cs
- DataControlFieldTypeEditor.cs
- DesignSurfaceCollection.cs
- CmsInterop.cs
- RootDesignerSerializerAttribute.cs
- BitmapSource.cs
- InvalidateEvent.cs
- WSTransactionSection.cs
- DisplayMemberTemplateSelector.cs
- x509store.cs
- ResourceBinder.cs
- WebProxyScriptElement.cs
- GridEntry.cs
- AutomationElement.cs
- BaseCodePageEncoding.cs
- PreservationFileReader.cs
- KnownTypeAttribute.cs
- CellParagraph.cs
- SR.cs
- JoinGraph.cs
- MetaChildrenColumn.cs
- RadioButtonBaseAdapter.cs
- ConnectivityStatus.cs
- XmlImplementation.cs
- HyperLinkColumn.cs
- namescope.cs
- StringPropertyBuilder.cs
- RootProfilePropertySettingsCollection.cs
- DropShadowBitmapEffect.cs
- ParserContext.cs
- TypeLoadException.cs
- HyperLinkStyle.cs
- OleDbDataReader.cs
- Vector3DValueSerializer.cs
- ObservableDictionary.cs
- relpropertyhelper.cs
- XmlComplianceUtil.cs
- HtmlTextArea.cs
- ProcessHostConfigUtils.cs
- XmlWrappingReader.cs
- Nullable.cs
- ComMethodElement.cs