Files
azuredatastudio/extensions/resource-deployment/src/ui/dialogBase.ts
Arvind Ranasaria af9984f73b pass install paths to notebooks (#8008)
* pass install paths to notebooks

* onComplete

* discover and publish actual installation Path

* pass the path to notebook

* minor fixes needed post merge of code from remote

* fix some errors

* remove unused variable
2019-10-25 12:06:55 -07:00

42 lines
1.3 KiB
TypeScript

/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as azdata from 'azdata';
import * as vscode from 'vscode';
export abstract class DialogBase {
protected _toDispose: vscode.Disposable[] = [];
protected _dialogObject: azdata.window.Dialog;
constructor(dialogTitle: string, dialogName: string, isWide: boolean = false) {
this._dialogObject = azdata.window.createModelViewDialog(dialogTitle, dialogName, isWide);
this._toDispose.push(this._dialogObject.cancelButton.onClick(() => this.onCancelButtonClicked()));
this._toDispose.push(this._dialogObject.okButton.onClick(() => this.onOkButtonClicked()));
}
protected abstract initialize(): void;
public open(): void {
this.initialize();
azdata.window.openDialog(this._dialogObject);
}
private onCancelButtonClicked(): void {
this.dispose();
}
private onOkButtonClicked(): void {
this.onComplete();
this.dispose();
}
protected onComplete(): void {
}
protected dispose(): void {
this._toDispose.forEach(disposable => disposable.dispose());
}
}