本文整理汇总了TypeScript中vs/workbench/browser/workbench.Workbench类的典型用法代码示例。如果您正苦于以下问题:TypeScript Workbench类的具体用法?TypeScript Workbench怎么用?TypeScript Workbench使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Workbench类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: domContentLoaded
return domContentLoaded().then(() => {
mark('willStartWorkbench');
// Create Workbench
this.workbench = new Workbench(document.body, services.serviceCollection, services.logService);
// Layout
this._register(addDisposableListener(window, EventType.RESIZE, e => this.onWindowResize(e, true)));
// Workbench Lifecycle
this._register(this.workbench.onShutdown(() => this.dispose()));
this._register(this.workbench.onWillShutdown(event => event.join(services.storageService.close())));
// Startup
const instantiationService = this.workbench.startup();
// Window
this._register(instantiationService.createInstance(ElectronWindow));
// Driver
if (this.configuration.driver) {
instantiationService.invokeFunction(accessor => registerWindowDriver(accessor).then(disposable => this._register(disposable)));
}
// Config Exporter
if (this.configuration['export-default-configuration']) {
instantiationService.createInstance(DefaultConfigurationExportHelper);
}
// Logging
services.logService.trace('workbench configuration', JSON.stringify(this.configuration));
});
开发者ID:joelday,项目名称:vscode,代码行数:32,代码来源:main.ts
示例2: domContentLoaded
return domContentLoaded().then(() => {
mark('willStartWorkbench');
// Create Workbench
this.workbench = new Workbench(
document.body,
services.serviceCollection,
services.logService
);
// Layout
this._register(addDisposableListener(window, EventType.RESIZE, () => this.workbench.layout()));
// Workbench Lifecycle
this._register(this.workbench.onShutdown(() => this.dispose()));
// Startup
this.workbench.startup();
});
开发者ID:joelday,项目名称:vscode,代码行数:19,代码来源:nodeless.main.ts
示例3: onWindowResize
private onWindowResize(e: Event, retry: boolean): void {
if (e.target === window) {
if (window.document && window.document.body && window.document.body.clientWidth === 0) {
// TODO@Ben this is an electron issue on macOS when simple fullscreen is enabled
// where for some reason the window clientWidth is reported as 0 when switching
// between simple fullscreen and normal screen. In that case we schedule the layout
// call at the next animation frame once, in the hope that the dimensions are
// proper then.
if (retry) {
scheduleAtNextAnimationFrame(() => this.onWindowResize(e, false));
}
return;
}
this.workbench.layout();
}
}
开发者ID:joelday,项目名称:vscode,代码行数:17,代码来源:main.ts
示例4:
this._register(addDisposableListener(window, EventType.RESIZE, () => this.workbench.layout()));
开发者ID:joelday,项目名称:vscode,代码行数:1,代码来源:nodeless.main.ts
注:本文中的vs/workbench/browser/workbench.Workbench类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论