mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-17 17:22:42 -05:00
Add AzureAccount service (#18502)
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import './mainThreadAzureAccount';
|
||||
import './mainThreadAccountManagement';
|
||||
import './mainThreadBackgroundTaskManagement';
|
||||
import './mainThreadConnectionManagement';
|
||||
|
||||
37
src/sql/workbench/api/browser/mainThreadAzureAccount.ts
Normal file
37
src/sql/workbench/api/browser/mainThreadAzureAccount.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import type * as azurecore from 'azurecore';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import {
|
||||
ExtHostAzureAccountShape,
|
||||
MainThreadAzureAccountShape,
|
||||
SqlExtHostContext,
|
||||
SqlMainContext
|
||||
} from 'sql/workbench/api/common/sqlExtHost.protocol';
|
||||
import { IExtHostContext } from 'vs/workbench/api/common/extHost.protocol';
|
||||
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
|
||||
import { IAzureAccountService } from 'sql/platform/azureAccount/common/azureAccountService';
|
||||
import { AzureAccountService } from 'sql/workbench/services/azureAccount/browser/azureAccountService';
|
||||
|
||||
@extHostNamedCustomer(SqlMainContext.MainThreadAzureAccount)
|
||||
export class MainThreadAzureAccount extends Disposable implements MainThreadAzureAccountShape {
|
||||
private _proxy: ExtHostAzureAccountShape;
|
||||
public _serviceBrand: undefined;
|
||||
|
||||
constructor(
|
||||
extHostContext: IExtHostContext,
|
||||
@IAzureAccountService azureAccountService: IAzureAccountService
|
||||
) {
|
||||
super();
|
||||
this._proxy = extHostContext.getProxy(SqlExtHostContext.ExtHostAzureAccount);
|
||||
(azureAccountService as AzureAccountService).registerProxy(this);
|
||||
}
|
||||
|
||||
public async getSubscriptions(account: azurecore.AzureAccount, ignoreErrors?: boolean, selectedOnly?: boolean): Promise<azurecore.GetSubscriptionsResult> {
|
||||
return this._proxy.$getSubscriptions(account, ignoreErrors, selectedOnly);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user