public override async Task <IEnumerable <ConnectedServiceInstance> > EnumerateServiceInstancesAsync(CancellationToken ct) { IEnumerable <IAzureIoTHub> hubs = await this.Authenticator.GetAzureIoTHubs(this.iotHubAccountManager, ct).ConfigureAwait(false); ct.ThrowIfCancellationRequested(); return(hubs.Select(p => AzureIoTHubAccountProviderGrid.CreateServiceInstance(p)).ToList()); }
public override async Task <ConnectedServiceInstance> CreateServiceInstanceAsync(CancellationToken ct) { ConnectedServiceInstance result = null; IAzureIoTHub createdAccount = await this.Authenticator.CreateIoTHub(this.iotHubAccountManager, ct).ConfigureAwait(false); if (createdAccount != null) { result = AzureIoTHubAccountProviderGrid.CreateServiceInstance(createdAccount); } return(result); }
public override Task<ConnectedServiceConfigurator> CreateConfiguratorAsync(ConnectedServiceProviderContext context) { ConnectedServiceConfigurator configurator; var project = GetActiveProject(); var projectKind = new Guid(project.Kind); if (projectKind != CsProjectType) { // For now, only C# projects support TPM. configurator = new AzureIoTHubAccountProviderGrid(this.IoTHubAccountManager, this.ServiceProvider); } else { var securityMode = new TPMSelector(); var dlgResult = securityMode.ShowModal(); if (dlgResult.HasValue && dlgResult.Value) { var useTPM = securityMode.rbUseTPM.IsChecked; if (useTPM.HasValue && useTPM.Value) { // The user has chosen to use TPM configurator = new ConnectedServiceSansUI(false); } else { // No TPM configurator = new AzureIoTHubAccountProviderGrid(this.IoTHubAccountManager, this.ServiceProvider); } } else { // User cancelled configurator = new ConnectedServiceSansUI(true); } } return Task.FromResult(configurator); }
public override Task <ConnectedServiceConfigurator> CreateConfiguratorAsync(ConnectedServiceProviderContext context) { ConnectedServiceConfigurator configurator; var project = GetActiveProject(); var projectKind = new Guid(project.Kind); if (projectKind != CsProjectType) { // For now, only C# projects support TPM. configurator = new AzureIoTHubAccountProviderGrid(this.IoTHubAccountManager, this.ServiceProvider); } else { var securityMode = new TPMSelector(); var dlgResult = securityMode.ShowModal(); if (dlgResult.HasValue && dlgResult.Value) { var useTPM = securityMode.rbUseTPM.IsChecked; if (useTPM.HasValue && useTPM.Value) { // The user has chosen to use TPM configurator = new ConnectedServiceSansUI(false); } else { // No TPM configurator = new AzureIoTHubAccountProviderGrid(this.IoTHubAccountManager, this.ServiceProvider); } } else { // User cancelled configurator = new ConnectedServiceSansUI(true); } } return(Task.FromResult(configurator)); }