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
- DirectoryRootQuery.cs
- DbProviderConfigurationHandler.cs
- IisTraceListener.cs
- FormViewInsertEventArgs.cs
- OdbcStatementHandle.cs
- PropertyRecord.cs
- MetadataPropertyAttribute.cs
- ContainerFilterService.cs
- BaseValidator.cs
- GCHandleCookieTable.cs
- DataTemplateSelector.cs
- ObjectStateFormatter.cs
- AttachmentService.cs
- MessageDirection.cs
- UserMapPath.cs
- CancelEventArgs.cs
- ObjectItemAssemblyLoader.cs
- WebScriptEndpointElement.cs
- metadatamappinghashervisitor.hashsourcebuilder.cs
- DataRecordInfo.cs
- DirectionalLight.cs
- TextViewBase.cs
- SQLGuidStorage.cs
- NullReferenceException.cs
- Timer.cs
- CustomAttributeFormatException.cs
- FlowchartSizeFeature.cs
- AsyncResult.cs
- LogArchiveSnapshot.cs
- SecurityContext.cs
- XmlElementAttribute.cs
- BackgroundFormatInfo.cs
- WindowsAuthenticationEventArgs.cs
- CategoryNameCollection.cs
- HwndMouseInputProvider.cs
- AnnotationHelper.cs
- CodeGenHelper.cs
- CompilerLocalReference.cs
- GenericParameterDataContract.cs
- ServiceModelExtensionElement.cs
- SchemaDeclBase.cs
- DateTimeHelper.cs
- IOException.cs
- EdmToObjectNamespaceMap.cs
- SqlBulkCopyColumnMapping.cs
- SectionVisual.cs
- ItemsPanelTemplate.cs
- ConfigurationElementProperty.cs
- OdbcConnectionOpen.cs
- RootBrowserWindowAutomationPeer.cs
- AudioBase.cs
- Enum.cs
- PrinterUnitConvert.cs
- LoginStatusDesigner.cs
- SharedDp.cs
- AtomicFile.cs
- Figure.cs
- MulticastDelegate.cs
- ConstraintCollection.cs
- RuntimeArgumentHandle.cs
- SchemaElementDecl.cs
- ObsoleteAttribute.cs
- Encoder.cs
- ExpressionBinding.cs
- ReflectionUtil.cs
- TableItemStyle.cs
- ExpressionBuilderCollection.cs
- DefaultTypeArgumentAttribute.cs
- PackageFilter.cs
- BamlRecordReader.cs
- GradientBrush.cs
- XamlContextStack.cs
- FileEnumerator.cs
- SettingsBindableAttribute.cs
- OdbcDataReader.cs
- LiteralLink.cs
- _TLSstream.cs
- SoapHeaders.cs
- DrawToolTipEventArgs.cs
- SByte.cs
- RegisteredDisposeScript.cs
- Visitors.cs
- EntityParameterCollection.cs
- EntityDataSourceChangingEventArgs.cs
- UIPropertyMetadata.cs
- RtfToken.cs
- AuthenticatedStream.cs
- BasicBrowserDialog.designer.cs
- PageTheme.cs
- BrowserCapabilitiesCompiler.cs
- NetworkInformationPermission.cs
- GridItem.cs
- DataGridCellClipboardEventArgs.cs
- DispatcherHookEventArgs.cs
- FileReservationCollection.cs
- StandardOleMarshalObject.cs
- UnicodeEncoding.cs
- ImageAttributes.cs
- TraceLevelStore.cs
- StringFunctions.cs