internal IPagedEnumerable <CloudJob> ListJobsImpl(string jobScheduleId, BehaviorManager bhMgr, DetailLevel detailLevel) { PagedEnumerable <CloudJob> enumerable = new PagedEnumerable <CloudJob>( // the lamda will be the enumerator factory () => { // here is the actual strongly typed enumerator that lists-by-job-schedule AsyncListJobsEnumerator typedEnumerator = new AsyncListJobsEnumerator(this.ParentBatchClient, jobScheduleId, bhMgr, detailLevel); // here is the base PagedEnumeratorBase <CloudJob> enumeratorBase = typedEnumerator; return(enumeratorBase); }); return(enumerable); }
/// <summary> /// Enumerates the <see cref="CloudJobSchedule">job schedules</see> in the Batch account. /// </summary> /// <param name="detailLevel">A <see cref="DetailLevel"/> used for filtering the list and for controlling which properties are retrieved from the service.</param> /// <param name="additionalBehaviors">A collection of <see cref="BatchClientBehavior"/> instances that are applied to the Batch service request after the <see cref="CustomBehaviors"/> and <paramref name="detailLevel"/>.</param> /// <returns>An <see cref="IPagedEnumerable{CloudJobSchedule}"/> that can be used to enumerate job schedules asynchronously or synchronously.</returns> /// <remarks>This method returns immediately; the job schedules are retrieved from the Batch service only when the collection is enumerated. /// Retrieval is non-atomic; schedules are retrieved in pages during enumeration of the collection.</remarks> public IPagedEnumerable <CloudJobSchedule> ListJobSchedules(DetailLevel detailLevel = null, IEnumerable <BatchClientBehavior> additionalBehaviors = null) { // set up behavior manager BehaviorManager bhMgr = new BehaviorManager(this.CustomBehaviors, additionalBehaviors); PagedEnumerable <CloudJobSchedule> enumerable = new PagedEnumerable <CloudJobSchedule>( // the lamda will be the enumerator factory () => { // here is the actual strongly typed enumerator AsyncListJobSchedulesEnumerator typedEnumerator = new AsyncListJobSchedulesEnumerator(this, bhMgr, detailLevel); // here is the base PagedEnumeratorBase <CloudJobSchedule> enumeratorBase = typedEnumerator; return(enumeratorBase); }); return(enumerable); }
/// <summary> /// Enumerates the <see cref="ApplicationSummary">applications</see> in the Batch account. /// </summary> /// <param name="detailLevel">A <see cref="DetailLevel"/> used for filtering the list and for controlling which properties are retrieved from the service.</param> /// <param name="additionalBehaviors">A collection of <see cref="BatchClientBehavior"/> instances that are applied to the Batch service request after the <see cref="CustomBehaviors"/> and <paramref name="detailLevel"/>.</param> /// <returns>An <see cref="IPagedEnumerable{ApplicationSummary}"/> that can be used to enumerate applications asynchronously or synchronously.</returns> /// <remarks>This method returns immediately; the applications are retrieved from the Batch service only when the collection is enumerated. /// Retrieval is non-atomic; applications are retrieved in pages during enumeration of the collection.</remarks> public IPagedEnumerable <ApplicationSummary> ListApplicationSummaries(DetailLevel detailLevel = null, IEnumerable <BatchClientBehavior> additionalBehaviors = null) { // craft the behavior manager for this call BehaviorManager bhMgr = new BehaviorManager(this.CustomBehaviors, additionalBehaviors); PagedEnumerable <ApplicationSummary> enumerable = new PagedEnumerable <ApplicationSummary>( // the lambda will be the enumerator factory () => { // here is the actual strongly typed enumerator AsyncApplicationSummariesEnumerator typedEnumerator = new AsyncApplicationSummariesEnumerator(this, bhMgr, detailLevel); // here is the base PagedEnumeratorBase <ApplicationSummary> enumeratorBase = typedEnumerator; return(enumeratorBase); }); return(enumerable); }
// IPagedEnumerable public IPagedEnumerator <EnumerationType> GetPagedEnumerator() { PagedEnumeratorBase <EnumerationType> newEnumerator = _enumeratorFactory(); return(newEnumerator); }
// IEnumerable IEnumerator System.Collections.IEnumerable.GetEnumerator() { PagedEnumeratorBase <EnumerationType> newEnumerator = _enumeratorFactory(); return(newEnumerator); }