當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript workbench.Workbench類代碼示例

本文整理匯總了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;未經允許,請勿轉載。