Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- Main.cs
- NamespaceInfo.cs
- IntegerFacetDescriptionElement.cs
- TreeNodeClickEventArgs.cs
- EncoderNLS.cs
- IPipelineRuntime.cs
- StorageMappingFragment.cs
- ComplexBindingPropertiesAttribute.cs
- NavigationWindow.cs
- DesignerDeviceConfig.cs
- FormatterConverter.cs
- MenuItemStyleCollection.cs
- recordstatefactory.cs
- DesignerTransactionCloseEvent.cs
- DSGeneratorProblem.cs
- UInt16Storage.cs
- InheritanceRules.cs
- PointAnimationUsingKeyFrames.cs
- EntitySqlQueryCacheKey.cs
- RecordsAffectedEventArgs.cs
- ProviderMetadataCachedInformation.cs
- LambdaReference.cs
- InheritablePropertyChangeInfo.cs
- PropertyDescriptorGridEntry.cs
- LinqDataSourceInsertEventArgs.cs
- HttpValueCollection.cs
- InfoCardBaseException.cs
- FillErrorEventArgs.cs
- AnchoredBlock.cs
- HostUtils.cs
- ObjectStateEntry.cs
- PrivacyNoticeBindingElement.cs
- CodeArrayCreateExpression.cs
- SortFieldComparer.cs
- RegistrationServices.cs
- SynchronizationLockException.cs
- TreeNode.cs
- ReadingWritingEntityEventArgs.cs
- XamlParser.cs
- ToolStripCustomTypeDescriptor.cs
- GAC.cs
- PrintController.cs
- XmlDigitalSignatureProcessor.cs
- DataGridViewCellStyleConverter.cs
- AuthorizationSection.cs
- SaveFileDialogDesigner.cs
- Double.cs
- ConnectionStringSettings.cs
- RegexCompilationInfo.cs
- TemplatedControlDesigner.cs
- UpdatePanelTriggerCollection.cs
- RSAPKCS1SignatureFormatter.cs
- Table.cs
- LocatorBase.cs
- TypeDependencyAttribute.cs
- CompModSwitches.cs
- StringInfo.cs
- XmlAttributeProperties.cs
- EdmRelationshipNavigationPropertyAttribute.cs
- DbProviderFactoriesConfigurationHandler.cs
- XPathItem.cs
- ExtensionQuery.cs
- KerberosRequestorSecurityToken.cs
- RelOps.cs
- SimpleWorkerRequest.cs
- Page.cs
- XmlWrappingReader.cs
- PolicyReader.cs
- ScriptResourceHandler.cs
- OpenTypeCommon.cs
- ConversionContext.cs
- TableRow.cs
- EdmMember.cs
- WebPartConnectionsConnectVerb.cs
- TreeViewDesigner.cs
- OptimizedTemplateContentHelper.cs
- AccessDataSource.cs
- StoryFragments.cs
- Control.cs
- ImageSource.cs
- GcSettings.cs
- DefaultWorkflowTransactionService.cs
- ContentElement.cs
- XmlSerializerVersionAttribute.cs
- XmlNamedNodeMap.cs
- invalidudtexception.cs
- EntityCommandExecutionException.cs
- FixedDocumentSequencePaginator.cs
- GridSplitterAutomationPeer.cs
- XmlWellformedWriter.cs
- PropertySet.cs
- SafeBitVector32.cs
- Hashtable.cs
- ConfigXmlElement.cs
- GridItemPatternIdentifiers.cs
- AutoGeneratedField.cs
- CleanUpVirtualizedItemEventArgs.cs
- ConnectionStringsSection.cs
- FamilyTypefaceCollection.cs
- CopyNamespacesAction.cs