本文整理汇总了C#中IDataProvider.GetPoolCollectionAsync方法的典型用法代码示例。如果您正苦于以下问题:C# IDataProvider.GetPoolCollectionAsync方法的具体用法?C# IDataProvider.GetPoolCollectionAsync怎么用?C# IDataProvider.GetPoolCollectionAsync使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDataProvider
的用法示例。
在下文中一共展示了IDataProvider.GetPoolCollectionAsync方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetDataAsync
/// <summary>
/// Gets a specific set of data from the Batch service
/// </summary>
/// <param name="provider">The provider to retrieve the data with</param>
/// <param name="jobSchedules">True if job schedule data should be retrieved</param>
/// <param name="jobs">True if job data should be retrieved</param>
/// <param name="pools">True if pool data should be retrieved</param>
/// <returns></returns>
private async Task GetDataAsync(IDataProvider provider, bool jobSchedules, bool jobs, bool pools, bool certificates)
{
//Turn on the correct wait spinners
LeftSpinnerIsVisible = true;
UpperRightSpinnerIsVisible = false;
LowerRightSpinnerIsVisible = false;
try
{
//
// Get all the job schedules
//
if (jobSchedules)
{
System.Threading.Tasks.Task<IList<JobScheduleModel>> getJobSchedulesTask = provider.GetJobScheduleCollectionAsync();
AsyncOperationTracker.Instance.AddTrackedOperation(new AsyncOperationModel(
getJobSchedulesTask,
new AccountOperation(AccountOperation.ListJobSchedules)));
this.jobSchedules = new ObservableCollection<JobScheduleModel>(await getJobSchedulesTask);
this.jobScheduleCollection = CollectionViewSource.GetDefaultView(this.jobSchedules);
this.JobSchedules.Refresh();
FirePropertyChangedEvent("JobSchedules");
FirePropertyChangedEvent("JobScheduleTabTitle");
}
this.SelectedJobSchedule = null;
//
// Get all jobs
//
if (jobs)
{
System.Threading.Tasks.Task<IList<JobModel>> getJobTask = provider.GetJobCollectionAsync(this.JobsSearchFilter);
AsyncOperationTracker.Instance.AddTrackedOperation(new AsyncOperationModel(
getJobTask,
new AccountOperation(AccountOperation.ListJobs)));
this.jobs = new ObservableCollection<JobModel>(await getJobTask);
this.jobCollection = CollectionViewSource.GetDefaultView(this.jobs);
this.Jobs.Refresh();
FirePropertyChangedEvent("Jobs");
FirePropertyChangedEvent("JobTabTitle");
}
this.SelectedJob = null;
//
// Get all pools
//
if (pools)
{
System.Threading.Tasks.Task<IList<PoolModel>> getPoolsTask = provider.GetPoolCollectionAsync();
AsyncOperationTracker.Instance.AddTrackedOperation(new AsyncOperationModel(
getPoolsTask,
new AccountOperation(AccountOperation.ListPools)));
this.pools = new ObservableCollection<PoolModel>(await getPoolsTask);
Pools = CollectionViewSource.GetDefaultView(this.pools);
Pools.Refresh();
FirePropertyChangedEvent("Pools");
FirePropertyChangedEvent("PoolTabTitle");
}
SelectedPool = null;
this.SelectedComputeNode = null;
//
// Get all certificates
//
if (certificates)
{
System.Threading.Tasks.Task<IList<CertificateModel>> getCertificatesTask = provider.GetCertificatesCollectionAsync();
AsyncOperationTracker.Instance.AddTrackedOperation(new AsyncOperationModel(
getCertificatesTask,
new AccountOperation(AccountOperation.ListCertificates)));
this.certificates = new ObservableCollection<CertificateModel>(await getCertificatesTask);
Certificates = CollectionViewSource.GetDefaultView(this.certificates);
Certificates.Refresh();
FirePropertyChangedEvent("Certificates");
FirePropertyChangedEvent("CertificatesTabTitle");
}
SelectedCertificate = null;
}
catch (Exception e)
{
Messenger.Default.Send(new GenericDialogMessage(e.ToString()));
}
//.........这里部分代码省略.........