Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataWeb / Client / System / Data / Services / Client / ProjectionPath.cs / 1305376 / ProjectionPath.cs
//----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Provides a class to represent an annotated path of segments
// (each of which is a step in the parsed tree).
//
//---------------------------------------------------------------------
namespace System.Data.Services.Client
{
#region Namespaces.
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq.Expressions;
using System.Text;
#endregion Namespaces.
/// Use this class to represent an annotated list of path segments.
[DebuggerDisplay("{ToString()}")]
internal class ProjectionPath : List
{
#region Constructors.
/// Initializes a new instance.
internal ProjectionPath() : base()
{
}
/// Initializes a new instance.
/// Root parameter for this path.
/// Expression to get the expected root type in the target tree.
/// Expression for the root entry.
internal ProjectionPath(ParameterExpression root, Expression expectedRootType, Expression rootEntry)
: base()
{
this.Root = root;
this.RootEntry = rootEntry;
this.ExpectedRootType = expectedRootType;
}
/// Initializes a new instance.
/// Root parameter for this path.
/// Expression to get the expected root type in the target tree.
/// Expression for the root entry.
/// Member to initialize the path with.
internal ProjectionPath(ParameterExpression root, Expression expectedRootType, Expression rootEntry, IEnumerable members)
: this(root, expectedRootType, rootEntry)
{
Debug.Assert(members != null, "members != null");
foreach (Expression member in members)
{
this.Add(new ProjectionPathSegment(this, ((MemberExpression)member).Member.Name, member.Type));
}
}
#endregion Constructors.
#region Internal properties.
/// Parameter expression in the source tree.
internal ParameterExpression Root
{
get;
private set;
}
/// Expression to get the entry for in the target tree.
internal Expression RootEntry
{
get;
private set;
}
/// Expression to get the expected root type in the target tree.
internal Expression ExpectedRootType
{
get;
private set;
}
#endregion Internal properties.
#region Methods.
/// Provides a string representation of this object.
/// A string representation of this object, suitable for debugging.
public override string ToString()
{
StringBuilder builder = new StringBuilder();
builder.Append(this.Root.ToString());
builder.Append("->");
for (int i = 0; i < this.Count; i++)
{
if (i > 0)
{
builder.Append('.');
}
builder.Append(this[i].Member == null ? "*" : this[i].Member);
}
return builder.ToString();
}
#endregion Methods.
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Provides a class to represent an annotated path of segments
// (each of which is a step in the parsed tree).
//
//---------------------------------------------------------------------
namespace System.Data.Services.Client
{
#region Namespaces.
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq.Expressions;
using System.Text;
#endregion Namespaces.
/// Use this class to represent an annotated list of path segments.
[DebuggerDisplay("{ToString()}")]
internal class ProjectionPath : List
{
#region Constructors.
/// Initializes a new instance.
internal ProjectionPath() : base()
{
}
/// Initializes a new instance.
/// Root parameter for this path.
/// Expression to get the expected root type in the target tree.
/// Expression for the root entry.
internal ProjectionPath(ParameterExpression root, Expression expectedRootType, Expression rootEntry)
: base()
{
this.Root = root;
this.RootEntry = rootEntry;
this.ExpectedRootType = expectedRootType;
}
/// Initializes a new instance.
/// Root parameter for this path.
/// Expression to get the expected root type in the target tree.
/// Expression for the root entry.
/// Member to initialize the path with.
internal ProjectionPath(ParameterExpression root, Expression expectedRootType, Expression rootEntry, IEnumerable members)
: this(root, expectedRootType, rootEntry)
{
Debug.Assert(members != null, "members != null");
foreach (Expression member in members)
{
this.Add(new ProjectionPathSegment(this, ((MemberExpression)member).Member.Name, member.Type));
}
}
#endregion Constructors.
#region Internal properties.
/// Parameter expression in the source tree.
internal ParameterExpression Root
{
get;
private set;
}
/// Expression to get the entry for in the target tree.
internal Expression RootEntry
{
get;
private set;
}
/// Expression to get the expected root type in the target tree.
internal Expression ExpectedRootType
{
get;
private set;
}
#endregion Internal properties.
#region Methods.
/// Provides a string representation of this object.
/// A string representation of this object, suitable for debugging.
public override string ToString()
{
StringBuilder builder = new StringBuilder();
builder.Append(this.Root.ToString());
builder.Append("->");
for (int i = 0; i < this.Count; i++)
{
if (i > 0)
{
builder.Append('.');
}
builder.Append(this[i].Member == null ? "*" : this[i].Member);
}
return builder.ToString();
}
#endregion Methods.
}
}
// 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
- TextControl.cs
- CodeTypeDeclarationCollection.cs
- XmlDigitalSignatureProcessor.cs
- XPathMultyIterator.cs
- ItemsPresenter.cs
- MissingManifestResourceException.cs
- WindowHelperService.cs
- RemoteWebConfigurationHostStream.cs
- TextMetrics.cs
- LinkedResourceCollection.cs
- DbTransaction.cs
- InvalidPrinterException.cs
- DataKeyCollection.cs
- FindCriteriaCD1.cs
- CodeTypeMember.cs
- DateTime.cs
- DictationGrammar.cs
- ClientRuntimeConfig.cs
- ImageMapEventArgs.cs
- Buffer.cs
- WebContext.cs
- TextTreePropertyUndoUnit.cs
- CommonDialog.cs
- MethodCallExpression.cs
- GridItemCollection.cs
- XmlReflectionMember.cs
- CancellationScope.cs
- State.cs
- AssemblySettingAttributes.cs
- ActivityDesigner.cs
- AmbientProperties.cs
- OleDbConnectionFactory.cs
- ButtonBase.cs
- InputScope.cs
- CodeNamespaceCollection.cs
- TokenBasedSetEnumerator.cs
- CollaborationHelperFunctions.cs
- OdbcConnectionStringbuilder.cs
- DataGrid.cs
- HostingPreferredMapPath.cs
- PageCodeDomTreeGenerator.cs
- WebResourceAttribute.cs
- CharacterString.cs
- HttpCapabilitiesSectionHandler.cs
- ProxyRpc.cs
- EncodingInfo.cs
- NameValueSectionHandler.cs
- HttpGetProtocolImporter.cs
- SizeIndependentAnimationStorage.cs
- WebChannelFactory.cs
- InlineCollection.cs
- DataGridViewRowStateChangedEventArgs.cs
- CmsUtils.cs
- ObjectSecurity.cs
- ListControl.cs
- TrustLevel.cs
- TextSerializer.cs
- WindowsStatic.cs
- ClientRoleProvider.cs
- BrowserDefinitionCollection.cs
- FamilyTypefaceCollection.cs
- PropertyPathWorker.cs
- RenderData.cs
- WebBrowserNavigatingEventHandler.cs
- PlainXmlWriter.cs
- Overlapped.cs
- DataServiceHostFactory.cs
- HwndKeyboardInputProvider.cs
- SecurityPolicySection.cs
- DocumentSequence.cs
- SecurityPolicySection.cs
- TrackPointCollection.cs
- TableNameAttribute.cs
- TextEditorSpelling.cs
- Char.cs
- XmlSchemaAnnotated.cs
- Maps.cs
- MetaModel.cs
- CmsUtils.cs
- SecurityPolicyVersion.cs
- HttpRequestContext.cs
- TextSimpleMarkerProperties.cs
- Rectangle.cs
- ExtensionWindowResizeGrip.cs
- PathNode.cs
- ValidatedControlConverter.cs
- HttpRuntime.cs
- CodeDirectiveCollection.cs
- PlatformCulture.cs
- HotSpot.cs
- IPAddressCollection.cs
- BuildDependencySet.cs
- EntityDesignerBuildProvider.cs
- AsyncPostBackErrorEventArgs.cs
- UnsafeNativeMethods.cs
- ResourceDisplayNameAttribute.cs
- NoneExcludedImageIndexConverter.cs
- ValidatorCollection.cs
- BinaryExpressionHelper.cs
- HandlerWithFactory.cs