Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / ndp / fx / src / DataWeb / Client / System / Data / Services / Client / ALinq / ParameterReplacerVisitor.cs / 1 / 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; using System.Collections.Generic; using System.Linq.Expressions; using System.Diagnostics; ///Provides an expression visitor that can replace a internal class ParameterReplacerVisitor : ExpressionVisitor { ///. 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. //---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // //// Provides an expression visitor that can replace a ParameterExpression. // // // @owner [....], [....] //--------------------------------------------------------------------- namespace System.Data.Services.Client { using System; using System.Collections.Generic; using System.Linq.Expressions; using System.Diagnostics; ///Provides an expression visitor that can replace a internal class ParameterReplacerVisitor : ExpressionVisitor { ///. 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
- HuffmanTree.cs
- ApplicationDirectoryMembershipCondition.cs
- HandledMouseEvent.cs
- WorkflowOperationInvoker.cs
- ProtocolsConfiguration.cs
- XmlSerializerVersionAttribute.cs
- CodeGenerator.cs
- Canvas.cs
- EmptyEnumerator.cs
- printdlgexmarshaler.cs
- VirtualDirectoryMappingCollection.cs
- EdmItemCollection.OcAssemblyCache.cs
- MenuItemStyle.cs
- ManagedWndProcTracker.cs
- ProcessHostFactoryHelper.cs
- UriWriter.cs
- SqlCacheDependencyDatabaseCollection.cs
- RootBrowserWindow.cs
- WindowsTab.cs
- smtppermission.cs
- WindowsNonControl.cs
- SourceInterpreter.cs
- EntityCommandDefinition.cs
- DeferredSelectedIndexReference.cs
- BitStream.cs
- Regex.cs
- OutputCacheSettings.cs
- RoutingBehavior.cs
- ConfigXmlComment.cs
- RuntimeUtils.cs
- XmlQueryType.cs
- StorageEntityContainerMapping.cs
- BindingSourceDesigner.cs
- XmlDataDocument.cs
- SerialErrors.cs
- ChannelRequirements.cs
- MSAANativeProvider.cs
- BaseCodeDomTreeGenerator.cs
- BrowsableAttribute.cs
- PointConverter.cs
- TemplateComponentConnector.cs
- Mapping.cs
- Point3DIndependentAnimationStorage.cs
- ApplicationSecurityInfo.cs
- FtpRequestCacheValidator.cs
- DataRowComparer.cs
- Activator.cs
- DataGridViewToolTip.cs
- ApplicationServiceHelper.cs
- SqlEnums.cs
- MDIClient.cs
- DataGridTextColumn.cs
- SqlConnectionHelper.cs
- StrokeSerializer.cs
- XmlValidatingReader.cs
- SecurityAlgorithmSuite.cs
- DockAndAnchorLayout.cs
- SHA384.cs
- DisplayToken.cs
- ToolStripItemImageRenderEventArgs.cs
- WindowsFormsHelpers.cs
- XmlElementAttributes.cs
- HwndHostAutomationPeer.cs
- BinaryWriter.cs
- SQLDouble.cs
- HtmlTextArea.cs
- GridEntry.cs
- Rectangle.cs
- SQLBytes.cs
- PageTheme.cs
- ReadOnlyAttribute.cs
- CaseExpr.cs
- AuthenticationModulesSection.cs
- GeneralTransform3DGroup.cs
- InputGestureCollection.cs
- XmlExceptionHelper.cs
- GridViewColumn.cs
- DesignerActionPropertyItem.cs
- GeneralTransform.cs
- SymLanguageVendor.cs
- DescendentsWalkerBase.cs
- MsmqIntegrationSecurityElement.cs
- SizeFConverter.cs
- RegisteredDisposeScript.cs
- OutputCacheSettings.cs
- ComplexBindingPropertiesAttribute.cs
- SecurityCookieModeValidator.cs
- RangeEnumerable.cs
- ReaderOutput.cs
- ResourceAttributes.cs
- Debug.cs
- DynamicDataRouteHandler.cs
- SoapTypeAttribute.cs
- Stopwatch.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- EntityStoreSchemaGenerator.cs
- RangeValidator.cs
- ResizeGrip.cs
- BrowsableAttribute.cs
- SmiEventSink_Default.cs