Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataWeb / Client / System / Data / Services / Client / DataServiceQueryContinuation.cs / 1305376 / DataServiceQueryContinuation.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // //// Provides a class to represent the continuation of a query. // //--------------------------------------------------------------------- namespace System.Data.Services.Client { #region Namespaces. using System.Collections.Generic; using System.Diagnostics; using System.Linq.Expressions; using System.Text; using System.Reflection; #endregion Namespaces. ///Use this class to represent the continuation of a query. [DebuggerDisplay("{NextLinkUri}")] public abstract class DataServiceQueryContinuation { #region Private fields. ///URI to next page of data. private readonly Uri nextLinkUri; ///Projection plan for results of next page. private readonly ProjectionPlan plan; #endregion Private fields. #region Constructors. ///Initializes a new /// URI to next page of data. /// Projection plan for results of next page. internal DataServiceQueryContinuation(Uri nextLinkUri, ProjectionPlan plan) { Debug.Assert(nextLinkUri != null, "nextLinkUri != null"); Debug.Assert(plan != null, "plan != null"); this.nextLinkUri = nextLinkUri; this.plan = plan; } #endregion Contructors. #region Properties. ///instance. The URI to the next page of data. public Uri NextLinkUri { get { return this.nextLinkUri; } } ///Type of element to be paged over. internal abstract Type ElementType { get; } ///Projection plan for the next page of data; null if not available. internal ProjectionPlan Plan { get { return this.plan; } } #endregion Properties. #region Methods. ///Provides a string representation of this continuation. ///String representation. public override string ToString() { return this.NextLinkUri.ToString(); } ///Creates a new /// Link to next page of data (possibly null). /// Plan to materialize the data (only null if nextLinkUri is null). ///instance. A new continuation object; null if nextLinkUri is null. internal static DataServiceQueryContinuation Create(Uri nextLinkUri, ProjectionPlan plan) { Debug.Assert(plan != null || nextLinkUri == null, "plan != null || nextLinkUri == null"); if (nextLinkUri == null) { return null; } var constructors = typeof(DataServiceQueryContinuation<>).MakeGenericType(plan.ProjectedType).GetConstructors(BindingFlags.NonPublic | BindingFlags.Instance); Debug.Assert(constructors.Length == 1, "constructors.Length == 1"); object result = Util.ConstructorInvoke(constructors[0], new object[] { nextLinkUri, plan }); return (DataServiceQueryContinuation)result; } ////// Initializes a new ///instance that can /// be used for this continuation. /// A new initializes internal QueryComponents CreateQueryComponents() { QueryComponents result = new QueryComponents(this.NextLinkUri, Util.DataServiceVersionEmpty, this.Plan.LastSegmentType, null, null); return result; } #endregion Methods. } ///. Use this class to represent the continuation of a query. ///Element type. public sealed class DataServiceQueryContinuation: DataServiceQueryContinuation { #region Contructors. /// Initializes a new typed instance. /// URI to next page of data. /// Projection plan for results of next page. internal DataServiceQueryContinuation(Uri nextLinkUri, ProjectionPlan plan) : base(nextLinkUri, plan) { } #endregion Contructors. #region Properties. ///Type of element to be paged over. internal override Type ElementType { get { return typeof(T); } } #endregion Properties. } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // //// Provides a class to represent the continuation of a query. // //--------------------------------------------------------------------- namespace System.Data.Services.Client { #region Namespaces. using System.Collections.Generic; using System.Diagnostics; using System.Linq.Expressions; using System.Text; using System.Reflection; #endregion Namespaces. ///Use this class to represent the continuation of a query. [DebuggerDisplay("{NextLinkUri}")] public abstract class DataServiceQueryContinuation { #region Private fields. ///URI to next page of data. private readonly Uri nextLinkUri; ///Projection plan for results of next page. private readonly ProjectionPlan plan; #endregion Private fields. #region Constructors. ///Initializes a new /// URI to next page of data. /// Projection plan for results of next page. internal DataServiceQueryContinuation(Uri nextLinkUri, ProjectionPlan plan) { Debug.Assert(nextLinkUri != null, "nextLinkUri != null"); Debug.Assert(plan != null, "plan != null"); this.nextLinkUri = nextLinkUri; this.plan = plan; } #endregion Contructors. #region Properties. ///instance. The URI to the next page of data. public Uri NextLinkUri { get { return this.nextLinkUri; } } ///Type of element to be paged over. internal abstract Type ElementType { get; } ///Projection plan for the next page of data; null if not available. internal ProjectionPlan Plan { get { return this.plan; } } #endregion Properties. #region Methods. ///Provides a string representation of this continuation. ///String representation. public override string ToString() { return this.NextLinkUri.ToString(); } ///Creates a new /// Link to next page of data (possibly null). /// Plan to materialize the data (only null if nextLinkUri is null). ///instance. A new continuation object; null if nextLinkUri is null. internal static DataServiceQueryContinuation Create(Uri nextLinkUri, ProjectionPlan plan) { Debug.Assert(plan != null || nextLinkUri == null, "plan != null || nextLinkUri == null"); if (nextLinkUri == null) { return null; } var constructors = typeof(DataServiceQueryContinuation<>).MakeGenericType(plan.ProjectedType).GetConstructors(BindingFlags.NonPublic | BindingFlags.Instance); Debug.Assert(constructors.Length == 1, "constructors.Length == 1"); object result = Util.ConstructorInvoke(constructors[0], new object[] { nextLinkUri, plan }); return (DataServiceQueryContinuation)result; } ////// Initializes a new ///instance that can /// be used for this continuation. /// A new initializes internal QueryComponents CreateQueryComponents() { QueryComponents result = new QueryComponents(this.NextLinkUri, Util.DataServiceVersionEmpty, this.Plan.LastSegmentType, null, null); return result; } #endregion Methods. } ///. Use this class to represent the continuation of a query. ///Element type. public sealed class DataServiceQueryContinuation: DataServiceQueryContinuation { #region Contructors. /// Initializes a new typed instance. /// URI to next page of data. /// Projection plan for results of next page. internal DataServiceQueryContinuation(Uri nextLinkUri, ProjectionPlan plan) : base(nextLinkUri, plan) { } #endregion Contructors. #region Properties. ///Type of element to be paged over. internal override Type ElementType { get { return typeof(T); } } #endregion Properties. } } // 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
- XmlSchemaGroup.cs
- LiteralDesigner.cs
- ExitEventArgs.cs
- MessageQueue.cs
- DifferencingCollection.cs
- ConfigurationProperty.cs
- TrackingExtract.cs
- ReflectPropertyDescriptor.cs
- TraceInternal.cs
- SqlDataSourceDesigner.cs
- RowBinding.cs
- VideoDrawing.cs
- TimeoutValidationAttribute.cs
- DeadCharTextComposition.cs
- ClientConfigurationSystem.cs
- AttributedMetaModel.cs
- CommonProperties.cs
- TransportationConfigurationTypeInstallComponent.cs
- ChannelRequirements.cs
- FormViewCommandEventArgs.cs
- RuntimeTransactionHandle.cs
- InsufficientMemoryException.cs
- UnionCodeGroup.cs
- ReachIDocumentPaginatorSerializerAsync.cs
- CodeIdentifier.cs
- ProfessionalColorTable.cs
- HandleCollector.cs
- OleDbConnection.cs
- CodeIdentifiers.cs
- TextTrailingCharacterEllipsis.cs
- SspiNegotiationTokenAuthenticatorState.cs
- StringExpressionSet.cs
- CultureSpecificCharacterBufferRange.cs
- SamlEvidence.cs
- SafeRightsManagementPubHandle.cs
- OlePropertyStructs.cs
- DateTimeOffset.cs
- Win32SafeHandles.cs
- TextOutput.cs
- CodeAccessSecurityEngine.cs
- TagPrefixAttribute.cs
- OutputCacheProfileCollection.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- VectorAnimation.cs
- CheckBoxRenderer.cs
- EntityDataSourceValidationException.cs
- CodeAttributeArgument.cs
- XmlUtil.cs
- GraphicsState.cs
- NativeMethods.cs
- SingleObjectCollection.cs
- ServiceModelActivationSectionGroup.cs
- ListBoxChrome.cs
- HtmlEncodedRawTextWriter.cs
- BitmapEncoder.cs
- WindowsProgressbar.cs
- ComboBox.cs
- Vector3DCollection.cs
- TreeIterators.cs
- JapaneseCalendar.cs
- TextEffect.cs
- EdmProviderManifest.cs
- __FastResourceComparer.cs
- DataGridViewToolTip.cs
- StringInfo.cs
- InteropAutomationProvider.cs
- PublisherMembershipCondition.cs
- ItemContainerPattern.cs
- CodeVariableReferenceExpression.cs
- MouseCaptureWithinProperty.cs
- BrowserTree.cs
- MenuItemBindingCollection.cs
- AuthenticationModulesSection.cs
- ProtocolsConfigurationHandler.cs
- SystemUnicastIPAddressInformation.cs
- DESCryptoServiceProvider.cs
- UntrustedRecipientException.cs
- StringAnimationUsingKeyFrames.cs
- Metafile.cs
- DispatcherExceptionFilterEventArgs.cs
- XmlCustomFormatter.cs
- BamlBinaryWriter.cs
- FormatSettings.cs
- HttpFileCollection.cs
- SplitContainer.cs
- CommonBehaviorsSection.cs
- XmlSecureResolver.cs
- SqlAliasesReferenced.cs
- SortedList.cs
- NavigatorOutput.cs
- MailDefinition.cs
- handlecollector.cs
- DataGridItemAutomationPeer.cs
- ActivityExecutor.cs
- SplineKeyFrames.cs
- EntityContainerAssociationSetEnd.cs
- CannotUnloadAppDomainException.cs
- ProfessionalColorTable.cs
- SQLDoubleStorage.cs
- WebRequest.cs