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
- DeploymentSection.cs
- DbConnectionPoolIdentity.cs
- FileDialog_Vista.cs
- SqlXml.cs
- TargetParameterCountException.cs
- SmtpFailedRecipientsException.cs
- DataListGeneralPage.cs
- ValidationErrorInfo.cs
- XmlSerializerNamespaces.cs
- CaseInsensitiveHashCodeProvider.cs
- XXXInfos.cs
- Rotation3D.cs
- TreeNodeBindingCollection.cs
- PeerNameRecord.cs
- InputDevice.cs
- InternalSafeNativeMethods.cs
- XmlEntityReference.cs
- LineVisual.cs
- TextControlDesigner.cs
- SBCSCodePageEncoding.cs
- Viewport3DVisual.cs
- SecureEnvironment.cs
- PixelShader.cs
- WebZoneDesigner.cs
- UInt16.cs
- ServiceModelExtensionElement.cs
- ResponseStream.cs
- CurrencyManager.cs
- Decoder.cs
- CreateUserErrorEventArgs.cs
- ViewGenerator.cs
- FocusWithinProperty.cs
- SystemParameters.cs
- CompoundFileStreamReference.cs
- ListSortDescriptionCollection.cs
- Bitmap.cs
- PageBuildProvider.cs
- XmlCountingReader.cs
- SmtpNtlmAuthenticationModule.cs
- SubMenuStyleCollectionEditor.cs
- SiteMap.cs
- UIPropertyMetadata.cs
- StackOverflowException.cs
- TextureBrush.cs
- MimePart.cs
- RegistryKey.cs
- COM2IPerPropertyBrowsingHandler.cs
- HttpStreamMessage.cs
- StringComparer.cs
- DefaultAuthorizationContext.cs
- COM2IPerPropertyBrowsingHandler.cs
- Propagator.Evaluator.cs
- BaseCollection.cs
- StringSource.cs
- DelimitedListTraceListener.cs
- XpsSerializationManager.cs
- WorkflowRuntime.cs
- StrongTypingException.cs
- TextEditorMouse.cs
- LocatorBase.cs
- ObjectReaderCompiler.cs
- TiffBitmapDecoder.cs
- CellParagraph.cs
- FlagsAttribute.cs
- SystemColors.cs
- StaticTextPointer.cs
- WinInet.cs
- Size.cs
- Configuration.cs
- BinaryNode.cs
- DataGridViewColumnDesigner.cs
- SpellCheck.cs
- SerializationObjectManager.cs
- ErrorWebPart.cs
- DataError.cs
- SchemaImporterExtension.cs
- ComponentEvent.cs
- KeyTime.cs
- FormClosingEvent.cs
- PartitionedStream.cs
- GlyphElement.cs
- HierarchicalDataSourceControl.cs
- DynamicUpdateCommand.cs
- cryptoapiTransform.cs
- PersonalizationProvider.cs
- RotateTransform.cs
- AppDomainManager.cs
- EncoderReplacementFallback.cs
- HtmlTableCell.cs
- EmbeddedMailObjectsCollection.cs
- OlePropertyStructs.cs
- PageStatePersister.cs
- NativeMethods.cs
- HttpChannelHelper.cs
- DefaultValueTypeConverter.cs
- RuleSettingsCollection.cs
- WebEventCodes.cs
- XmlRootAttribute.cs
- DesignerTransaction.cs
- StatusBarItemAutomationPeer.cs