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 / DataServiceExpressionVisitor.cs / 1 / DataServiceExpressionVisitor.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // //// Expression Visitors for Linq to URI translator // // // @owner [....] //--------------------------------------------------------------------- namespace System.Data.Services.Client { using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Linq.Expressions; using System.Diagnostics; ////// Specific Vistior base class for the DataServiceQueryProvider. /// internal abstract class DataServiceExpressionVisitor : ExpressionVisitor { ////// Main visit method. /// /// Expression to visit ///Visited expression internal override Expression Visit(Expression exp) { if (exp == null) { return null; } switch ((ResourceExpressionType)exp.NodeType) { case ResourceExpressionType.RootResourceSet: case ResourceExpressionType.ResourceNavigationProperty: return this.VisitResourceSetExpression((ResourceSetExpression)exp); case ResourceExpressionType.ResourceNavigationPropertySingleton: return this.VisitNavigationPropertySingletonExpression((NavigationPropertySingletonExpression)exp); case ResourceExpressionType.InputReference: return this.VisitInputReferenceExpression((InputReferenceExpression)exp); default: return base.Visit(exp); } } ////// ResourceSetExpression visit method. /// /// ResourceSetExpression expression to visit ///Visited ResourceSetExpression expression internal virtual Expression VisitResourceSetExpression(ResourceSetExpression rse) { Expression source = this.Visit(rse.Source); if (source != rse.Source) { rse = new ResourceSetExpression(rse.Type, source, rse.MemberExpression, rse.ResourceType, rse.ExpandPaths, rse.CustomQueryOptions); } return rse; } ////// NavigationPropertySingletonExpressionvisit method. /// /// NavigationPropertySingletonExpression expression to visit ///Visited NavigationPropertySingletonExpression expression internal virtual Expression VisitNavigationPropertySingletonExpression(NavigationPropertySingletonExpression npse) { Expression source = this.Visit(npse.Source); if (source != npse.Source) { npse = new NavigationPropertySingletonExpression(npse.Type, source, npse.MemberExpression, npse.ExpandPaths, npse.CustomQueryOptions); } return npse; } ////// Visit an /// InputReferenceExpression expression to visit ///, producing a new InputReferenceExpression /// based on the visited form of the that is referenced by /// the InputReferenceExpression argument, . /// Visited InputReferenceExpression expression internal virtual Expression VisitInputReferenceExpression(InputReferenceExpression ire) { if (ire == null) { return null; } ResourceExpression re = (ResourceExpression)this.Visit(ire.Target); return re.CreateReference(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // //// Expression Visitors for Linq to URI translator // // // @owner [....] //--------------------------------------------------------------------- namespace System.Data.Services.Client { using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Linq.Expressions; using System.Diagnostics; ////// Specific Vistior base class for the DataServiceQueryProvider. /// internal abstract class DataServiceExpressionVisitor : ExpressionVisitor { ////// Main visit method. /// /// Expression to visit ///Visited expression internal override Expression Visit(Expression exp) { if (exp == null) { return null; } switch ((ResourceExpressionType)exp.NodeType) { case ResourceExpressionType.RootResourceSet: case ResourceExpressionType.ResourceNavigationProperty: return this.VisitResourceSetExpression((ResourceSetExpression)exp); case ResourceExpressionType.ResourceNavigationPropertySingleton: return this.VisitNavigationPropertySingletonExpression((NavigationPropertySingletonExpression)exp); case ResourceExpressionType.InputReference: return this.VisitInputReferenceExpression((InputReferenceExpression)exp); default: return base.Visit(exp); } } ////// ResourceSetExpression visit method. /// /// ResourceSetExpression expression to visit ///Visited ResourceSetExpression expression internal virtual Expression VisitResourceSetExpression(ResourceSetExpression rse) { Expression source = this.Visit(rse.Source); if (source != rse.Source) { rse = new ResourceSetExpression(rse.Type, source, rse.MemberExpression, rse.ResourceType, rse.ExpandPaths, rse.CustomQueryOptions); } return rse; } ////// NavigationPropertySingletonExpressionvisit method. /// /// NavigationPropertySingletonExpression expression to visit ///Visited NavigationPropertySingletonExpression expression internal virtual Expression VisitNavigationPropertySingletonExpression(NavigationPropertySingletonExpression npse) { Expression source = this.Visit(npse.Source); if (source != npse.Source) { npse = new NavigationPropertySingletonExpression(npse.Type, source, npse.MemberExpression, npse.ExpandPaths, npse.CustomQueryOptions); } return npse; } ////// Visit an /// InputReferenceExpression expression to visit ///, producing a new InputReferenceExpression /// based on the visited form of the that is referenced by /// the InputReferenceExpression argument, . /// Visited InputReferenceExpression expression internal virtual Expression VisitInputReferenceExpression(InputReferenceExpression ire) { if (ire == null) { return null; } ResourceExpression re = (ResourceExpression)this.Visit(ire.Target); return re.CreateReference(); } } } // 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
- InputQueueChannel.cs
- EditorZone.cs
- MembershipAdapter.cs
- Timer.cs
- ProcessModelSection.cs
- ObjectAssociationEndMapping.cs
- HierarchicalDataTemplate.cs
- AssemblyAssociatedContentFileAttribute.cs
- UrlSyndicationContent.cs
- AgileSafeNativeMemoryHandle.cs
- TextEffectResolver.cs
- AccessDataSourceView.cs
- HandlerBase.cs
- DataServiceContext.cs
- Transform3D.cs
- XsdBuildProvider.cs
- __ComObject.cs
- DetailsViewAutoFormat.cs
- Message.cs
- WhiteSpaceTrimStringConverter.cs
- MachineKeySection.cs
- XpsImage.cs
- BitmapEffectState.cs
- SqlRecordBuffer.cs
- HMACSHA1.cs
- SqlInternalConnection.cs
- RegexGroup.cs
- CookieProtection.cs
- OwnerDrawPropertyBag.cs
- NullNotAllowedCollection.cs
- EdmValidator.cs
- WeakReference.cs
- OdbcFactory.cs
- ConstrainedGroup.cs
- ToolStripItemImageRenderEventArgs.cs
- DataRecordObjectView.cs
- FontDifferentiator.cs
- HttpListenerRequestUriBuilder.cs
- XamlPointCollectionSerializer.cs
- XmlArrayAttribute.cs
- ImageListStreamer.cs
- XamlTypeMapper.cs
- _HeaderInfo.cs
- SimpleExpression.cs
- CatchDesigner.xaml.cs
- FixedNode.cs
- SimpleParser.cs
- AuthenticationService.cs
- ThrowHelper.cs
- ImageCodecInfoPrivate.cs
- ErrorLog.cs
- ProcessHost.cs
- SqlDataSourceCommandParser.cs
- ContentHostHelper.cs
- StringArrayConverter.cs
- PeerCollaboration.cs
- Encoder.cs
- TypeContext.cs
- BindStream.cs
- DataTableMapping.cs
- DependencyObjectPropertyDescriptor.cs
- CustomCategoryAttribute.cs
- GridViewDeletedEventArgs.cs
- JsonStringDataContract.cs
- RegexCode.cs
- StorageEntitySetMapping.cs
- BaseDataList.cs
- TextRunProperties.cs
- TransformGroup.cs
- TypedCompletedAsyncResult.cs
- TypeSystem.cs
- WeakHashtable.cs
- ActivityPreviewDesigner.cs
- AutomationIdentifier.cs
- ConfigurationManager.cs
- Queue.cs
- TimeManager.cs
- XDRSchema.cs
- MULTI_QI.cs
- VectorAnimationUsingKeyFrames.cs
- SoapAttributes.cs
- Globals.cs
- VisualTarget.cs
- InternalDispatchObject.cs
- BitmapSource.cs
- XhtmlBasicSelectionListAdapter.cs
- StringFunctions.cs
- PrimitiveDataContract.cs
- AbstractDataSvcMapFileLoader.cs
- CacheRequest.cs
- DrawingAttributesDefaultValueFactory.cs
- ImageCollectionEditor.cs
- MessageBox.cs
- MenuCommandsChangedEventArgs.cs
- GridToolTip.cs
- OracleException.cs
- Vector3DCollectionValueSerializer.cs
- WebResponse.cs
- RegexCompilationInfo.cs
- OletxVolatileEnlistment.cs