Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- X509Certificate.cs
- MgmtResManager.cs
- EncryptedHeaderXml.cs
- CodeTypeMember.cs
- NetworkStream.cs
- LinqExpressionNormalizer.cs
- BindUriHelper.cs
- WebHeaderCollection.cs
- DataSetMappper.cs
- MetadataArtifactLoaderResource.cs
- DecimalAnimation.cs
- ObjectKeyFrameCollection.cs
- WebPartDescriptionCollection.cs
- DecimalConverter.cs
- DataGridViewLinkCell.cs
- DataGridViewRow.cs
- SqlConnectionHelper.cs
- QuaternionValueSerializer.cs
- NativeMethods.cs
- Route.cs
- XmlNavigatorFilter.cs
- ConstraintStruct.cs
- XmlSchemaComplexContent.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- querybuilder.cs
- GenericQueueSurrogate.cs
- InvariantComparer.cs
- CustomExpression.cs
- DisplayNameAttribute.cs
- OrderToken.cs
- ButtonChrome.cs
- HostingPreferredMapPath.cs
- PageSettings.cs
- HttpRequestCacheValidator.cs
- securitycriticaldata.cs
- ScriptDescriptor.cs
- SingleObjectCollection.cs
- EncodingStreamWrapper.cs
- Bits.cs
- ProviderConnectionPoint.cs
- DbProviderConfigurationHandler.cs
- XmlBinaryWriter.cs
- assemblycache.cs
- FormViewCommandEventArgs.cs
- DataSourceControlBuilder.cs
- EntityDataSourceWizardForm.cs
- IResourceProvider.cs
- SqlDataSourceConfigureSortForm.cs
- EntityDataSourceEntityTypeFilterItem.cs
- HashHelper.cs
- KeyEventArgs.cs
- OptimalBreakSession.cs
- SqlClientWrapperSmiStreamChars.cs
- PenThreadPool.cs
- CheckoutException.cs
- ControlOperationBehavior.cs
- SQLRoleProvider.cs
- BrushConverter.cs
- ExtractorMetadata.cs
- ProfileInfo.cs
- MissingFieldException.cs
- JsonReaderDelegator.cs
- PeerChannelListener.cs
- BamlBinaryReader.cs
- SerialReceived.cs
- DispatcherHooks.cs
- SqlNotificationRequest.cs
- ProtocolsConfigurationEntry.cs
- PermissionRequestEvidence.cs
- ImageKeyConverter.cs
- BamlRecordHelper.cs
- WebPartManagerDesigner.cs
- EmptyEnumerator.cs
- LogSwitch.cs
- xml.cs
- ListViewItemMouseHoverEvent.cs
- DefaultValidator.cs
- WebPartEditorCancelVerb.cs
- SqlUtils.cs
- ArgumentsParser.cs
- SocketManager.cs
- CheckStoreFileValidityRequest.cs
- CacheAxisQuery.cs
- LocalValueEnumerator.cs
- ValuePatternIdentifiers.cs
- TabControl.cs
- SecuritySessionClientSettings.cs
- PanelDesigner.cs
- ManagementScope.cs
- ManipulationInertiaStartingEventArgs.cs
- ScalarConstant.cs
- ServicesUtilities.cs
- DataSourceXmlSerializer.cs
- HttpCapabilitiesBase.cs
- ReferenceList.cs
- Model3DCollection.cs
- Parameter.cs
- UTF8Encoding.cs
- StatusBar.cs
- HybridDictionary.cs