mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-19 17:22:48 -05:00
Introduces event queue processor to create a consistent UI (#11780)
This commit is contained in:
@@ -27,6 +27,7 @@ export enum State {
|
||||
export interface Model {
|
||||
readonly sourceConnection: azdata.connection.Connection;
|
||||
readonly currentState: State;
|
||||
gatheringInformationError: string | undefined;
|
||||
}
|
||||
|
||||
export interface StateChangeEvent {
|
||||
@@ -37,6 +38,7 @@ export interface StateChangeEvent {
|
||||
export class MigrationStateModel implements Model, vscode.Disposable {
|
||||
private _stateChangeEventEmitter = new vscode.EventEmitter<StateChangeEvent>();
|
||||
private _currentState: State;
|
||||
private _gatheringInformationError: string | undefined;
|
||||
|
||||
constructor(private readonly _sourceConnection: azdata.connection.Connection) {
|
||||
this._currentState = State.INIT;
|
||||
@@ -58,6 +60,14 @@ export class MigrationStateModel implements Model, vscode.Disposable {
|
||||
this._stateChangeEventEmitter.fire({ oldState, newState: this.currentState });
|
||||
}
|
||||
|
||||
public get gatheringInformationError(): string | undefined {
|
||||
return this._gatheringInformationError;
|
||||
}
|
||||
|
||||
public set gatheringInformationError(error: string | undefined) {
|
||||
this._gatheringInformationError = error;
|
||||
}
|
||||
|
||||
public get stateChangeEvent(): vscode.Event<StateChangeEvent> {
|
||||
return this._stateChangeEventEmitter.event;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user