public async Task <IAzureIoTHub> CreateIoTHub( IAzureIoTHubAccountManager accountManager, CancellationToken cancellationToken) { Account account = await this.GetAccountAsync(); Debug.Assert(account != null && !account.NeedsReauthentication); return(await accountManager.CreateIoTHubAsync(this.serviceProvider, account, cancellationToken)); }
public AzureIoTHubAccountProviderGrid(IAzureIoTHubAccountManager accountManager, IServiceProvider serviceProvider) { this.iotHubAccountManager = accountManager; this.serviceProvider = serviceProvider; this.Description = Resource.IoTHubProvdierDescription; this.GridHeaderText = Resource.GridHeaderText; this.ServiceInstanceNameLabelText = Resource.ServiceInstanceNameLabelText; this.NoServiceInstancesText = Resource.NoServiceInstancesText; this.CreateServiceInstanceText = Resource.CreateServiceInstanceText; this.ConfigureServiceInstanceText = "Select Devices"; }
public async Task <IEnumerable <IAzureIoTHub> > GetAzureIoTHubs(IAzureIoTHubAccountManager accountManager, CancellationToken cancellationToken) { IEnumerable <IAzureRMSubscription> subscriptions = await this.GetAzureRMSubscriptions().ConfigureAwait(false); List <IAzureIoTHub> iotHubAccounts = new List <IAzureIoTHub>(); foreach (IAzureRMSubscription subscription in subscriptions) { IEnumerable <IAzureIoTHub> subscriptionAccounts = await accountManager.EnumerateIoTHubAccountsAsync(subscription, cancellationToken).ConfigureAwait(false); iotHubAccounts.AddRange(subscriptionAccounts); } return(iotHubAccounts); }
public async Task<IAzureIoTHub> CreateIoTHub( IAzureIoTHubAccountManager accountManager, CancellationToken cancellationToken) { Account account = await this.GetAccountAsync(); Debug.Assert(account != null && !account.NeedsReauthentication); return await accountManager.CreateIoTHubAsync(this.serviceProvider, account, cancellationToken); }
public async Task<IEnumerable<IAzureIoTHub>> GetAzureIoTHubs(IAzureIoTHubAccountManager accountManager, CancellationToken cancellationToken) { IEnumerable<IAzureRMSubscription> subscriptions = await this.GetAzureRMSubscriptions().ConfigureAwait(false); List<IAzureIoTHub> iotHubAccounts = new List<IAzureIoTHub>(); foreach (IAzureRMSubscription subscription in subscriptions) { IEnumerable<IAzureIoTHub> subscriptionAccounts = await accountManager.EnumerateIoTHubAccountsAsync(subscription, cancellationToken).ConfigureAwait(false); iotHubAccounts.AddRange(subscriptionAccounts); } return iotHubAccounts; }