mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-11 02:32:35 -05:00
SQL Operations Studio Public Preview 1 (0.23) release source code
This commit is contained in:
56
src/vs/platform/theme/test/common/testThemeService.ts
Normal file
56
src/vs/platform/theme/test/common/testThemeService.ts
Normal file
@@ -0,0 +1,56 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import Event, { Emitter } from 'vs/base/common/event';
|
||||
import { IThemeService, ITheme, DARK } from 'vs/platform/theme/common/themeService';
|
||||
import { Color } from 'vs/base/common/color';
|
||||
|
||||
export class TestTheme implements ITheme {
|
||||
|
||||
constructor(private colors: { [id: string]: string; } = {}, public type = DARK) {
|
||||
}
|
||||
|
||||
getColor(color: string, useDefault?: boolean): Color {
|
||||
let value = this.colors[color];
|
||||
if (value) {
|
||||
return Color.fromHex(value);
|
||||
}
|
||||
return void 0;
|
||||
}
|
||||
|
||||
defines(color: string): boolean {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
}
|
||||
|
||||
export class TestThemeService implements IThemeService {
|
||||
|
||||
_serviceBrand: any;
|
||||
_theme: ITheme;
|
||||
_onThemeChange = new Emitter<ITheme>();
|
||||
|
||||
constructor(theme = new TestTheme()) {
|
||||
this._theme = theme;
|
||||
}
|
||||
|
||||
getTheme(): ITheme {
|
||||
return this._theme;
|
||||
}
|
||||
|
||||
setTheme(theme: ITheme) {
|
||||
this._theme = theme;
|
||||
this.fireThemeChange();
|
||||
}
|
||||
|
||||
fireThemeChange() {
|
||||
this._onThemeChange.fire(this._theme);
|
||||
}
|
||||
|
||||
public get onThemeChange(): Event<ITheme> {
|
||||
return this._onThemeChange.event;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user