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
- RtfToXamlLexer.cs
- CodeGeneratorAttribute.cs
- EditingMode.cs
- XmlILConstructAnalyzer.cs
- ConnectionOrientedTransportManager.cs
- TextDecoration.cs
- DateBoldEvent.cs
- SecurityUtils.cs
- filewebresponse.cs
- ResourceFallbackManager.cs
- SelectionEditingBehavior.cs
- ComAdminInterfaces.cs
- MyContact.cs
- RowUpdatedEventArgs.cs
- NetworkStream.cs
- IndicFontClient.cs
- EventData.cs
- UnrecognizedAssertionsBindingElement.cs
- EventLogPermissionEntry.cs
- SystemPens.cs
- ListViewAutomationPeer.cs
- ToolStripDropDownButton.cs
- SiteMapNodeCollection.cs
- SequenceDesigner.cs
- comcontractssection.cs
- ParameterToken.cs
- MailMessageEventArgs.cs
- Stackframe.cs
- HMACRIPEMD160.cs
- RoutedEventArgs.cs
- RectAnimation.cs
- JulianCalendar.cs
- ExtractorMetadata.cs
- Directory.cs
- ConstantCheck.cs
- DescendentsWalker.cs
- rsa.cs
- CodeStatement.cs
- DrawToolTipEventArgs.cs
- ServerValidateEventArgs.cs
- DefaultWorkflowLoaderService.cs
- DesignerVerbCollection.cs
- Imaging.cs
- OleDbStruct.cs
- Hashtable.cs
- FileVersion.cs
- sortedlist.cs
- OleDbMetaDataFactory.cs
- UserControlParser.cs
- HandlerBase.cs
- BaseDataList.cs
- RetrieveVirtualItemEventArgs.cs
- StoragePropertyMapping.cs
- GB18030Encoding.cs
- DiscreteKeyFrames.cs
- HuffModule.cs
- KeyEvent.cs
- FastEncoderWindow.cs
- AuthenticatedStream.cs
- StringCollection.cs
- LineProperties.cs
- PropertyGridView.cs
- SqlException.cs
- DataSourceXmlTextReader.cs
- ConfigurationPropertyAttribute.cs
- ResXBuildProvider.cs
- ControlEvent.cs
- ISFTagAndGuidCache.cs
- ScriptingSectionGroup.cs
- Span.cs
- XPathNavigatorKeyComparer.cs
- ColumnResizeUndoUnit.cs
- DataGridViewAddColumnDialog.cs
- SystemIPInterfaceStatistics.cs
- DrawingAttributeSerializer.cs
- EndpointDesigner.cs
- handlecollector.cs
- PackageStore.cs
- ParseChildrenAsPropertiesAttribute.cs
- ManualResetEvent.cs
- BaseInfoTable.cs
- XmlReader.cs
- XmlObjectSerializerReadContextComplexJson.cs
- QueryAccessibilityHelpEvent.cs
- SecurityAppliedMessage.cs
- RecognizerInfo.cs
- DesignerHost.cs
- HtmlTableCellCollection.cs
- TransformPatternIdentifiers.cs
- _OSSOCK.cs
- ModuleBuilder.cs
- ProcessThreadCollection.cs
- WindowsRichEditRange.cs
- DependencyPropertyDescriptor.cs
- PageThemeParser.cs
- HtmlFormAdapter.cs
- HttpCachePolicy.cs
- MissingMemberException.cs
- MissingMethodException.cs
- ExitEventArgs.cs