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
- XmlDocumentType.cs
- RegionData.cs
- UICuesEvent.cs
- BitmapEffectGeneralTransform.cs
- BamlTreeUpdater.cs
- ImplicitInputBrush.cs
- EntityDesignPluralizationHandler.cs
- FamilyMapCollection.cs
- PropertyCollection.cs
- DataGridTextBox.cs
- ParserContext.cs
- AdornerHitTestResult.cs
- ResXResourceWriter.cs
- ThicknessConverter.cs
- ClientConfigurationHost.cs
- XsltContext.cs
- SendKeys.cs
- DES.cs
- TextEditorCopyPaste.cs
- dsa.cs
- BaseValidator.cs
- OrderedDictionary.cs
- XmlEntityReference.cs
- IgnoreFlushAndCloseStream.cs
- FormClosedEvent.cs
- LiteralSubsegment.cs
- WebPartUtil.cs
- TypeUnloadedException.cs
- FormsAuthentication.cs
- EntityContainer.cs
- XPathNodePointer.cs
- Tracer.cs
- querybuilder.cs
- DisplayMemberTemplateSelector.cs
- AmbientLight.cs
- CurrencyManager.cs
- XmlSerializer.cs
- HtmlInputImage.cs
- DataBoundControlHelper.cs
- TdsValueSetter.cs
- TemplateField.cs
- DynamicValidatorEventArgs.cs
- GestureRecognitionResult.cs
- AuthStoreRoleProvider.cs
- HtmlFormWrapper.cs
- OleDbMetaDataFactory.cs
- CalendarDesigner.cs
- DataStorage.cs
- XmlQuerySequence.cs
- CodeGroup.cs
- DesignerCategoryAttribute.cs
- _Connection.cs
- Pkcs9Attribute.cs
- MultilineStringConverter.cs
- WSSecureConversationDec2005.cs
- TreeSet.cs
- TrailingSpaceComparer.cs
- SetIndexBinder.cs
- HMACSHA1.cs
- NonVisualControlAttribute.cs
- ImageBrush.cs
- OdbcParameterCollection.cs
- ListMarkerSourceInfo.cs
- SmiContextFactory.cs
- EnumDataContract.cs
- UpdatePanel.cs
- FieldAccessException.cs
- PropertyDescriptor.cs
- RNGCryptoServiceProvider.cs
- ExeContext.cs
- CollectionChangedEventManager.cs
- ProxyGenerationError.cs
- Columns.cs
- TextStore.cs
- VScrollBar.cs
- DeadCharTextComposition.cs
- ColumnResizeAdorner.cs
- AQNBuilder.cs
- FontConverter.cs
- Accessors.cs
- PackageFilter.cs
- TextBoxAutomationPeer.cs
- CodeParameterDeclarationExpression.cs
- PenThread.cs
- CompensatableSequenceActivity.cs
- SqlDataSource.cs
- MappedMetaModel.cs
- ShaderEffect.cs
- TakeQueryOptionExpression.cs
- SqlDependency.cs
- RemoteHelper.cs
- CheckBoxBaseAdapter.cs
- InvalidEnumArgumentException.cs
- HttpMethodAttribute.cs
- PerspectiveCamera.cs
- AliasExpr.cs
- RemotingException.cs
- CodeAttachEventStatement.cs
- IDQuery.cs
- AssociationProvider.cs