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


TypeScript windows.IWindowsService類代碼示例

本文整理匯總了TypeScript中vs/platform/windows/common/windows.IWindowsService的典型用法代碼示例。如果您正苦於以下問題:TypeScript IWindowsService類的具體用法?TypeScript IWindowsService怎麽用?TypeScript IWindowsService使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了IWindowsService類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: revealResourcesInOS

function revealResourcesInOS(resources: URI[], windowsService: IWindowsService, notificationService: INotificationService, workspaceContextService: IWorkspaceContextService): void {
    if (resources.length) {
        sequence(resources.map(r => () => windowsService.showItemInFolder(paths.normalize(r.fsPath, true))));
    } else if (workspaceContextService.getWorkspace().folders.length) {
        windowsService.showItemInFolder(paths.normalize(workspaceContextService.getWorkspace().folders[0].uri.fsPath, true));
    } else {
        notificationService.info(nls.localize('openFileToReveal', "Open a file first to reveal"));
    }
}
開發者ID:jinlongchen2018,項目名稱:vscode,代碼行數:9,代碼來源:fileCommands.ts

示例2:

        sequence(resources.map(r => () => windowsService.showItemInFolder(paths.normalize(r.fsPath, true))));
開發者ID:jinlongchen2018,項目名稱:vscode,代碼行數:1,代碼來源:fileCommands.ts

示例3:

        sequence(resources.map(r => () => windowsService.showItemInFolder(r)));
開發者ID:joelday,項目名稱:vscode,代碼行數:1,代碼來源:fileCommands.ts

示例4: Error

    call(_: unknown, command: string, arg?: any): Promise<any> {
        switch (command) {
            case 'pickFileFolderAndOpen': return this.service.pickFileFolderAndOpen(arg);
            case 'pickFileAndOpen': return this.service.pickFileAndOpen(arg);
            case 'pickFolderAndOpen': return this.service.pickFolderAndOpen(arg);
            case 'pickWorkspaceAndOpen': return this.service.pickWorkspaceAndOpen(arg);
            case 'showMessageBox': return this.service.showMessageBox(arg[0], arg[1]);
            case 'showSaveDialog': return this.service.showSaveDialog(arg[0], arg[1]);
            case 'showOpenDialog': return this.service.showOpenDialog(arg[0], arg[1]);
            case 'reloadWindow': return this.service.reloadWindow(arg[0], arg[1]);
            case 'openDevTools': return this.service.openDevTools(arg[0], arg[1]);
            case 'toggleDevTools': return this.service.toggleDevTools(arg);
            case 'closeWorkspace': return this.service.closeWorkspace(arg);
            case 'enterWorkspace': return this.service.enterWorkspace(arg[0], URI.revive(arg[1]));
            case 'toggleFullScreen': return this.service.toggleFullScreen(arg);
            case 'setRepresentedFilename': return this.service.setRepresentedFilename(arg[0], arg[1]);
            case 'addRecentlyOpened': return this.service.addRecentlyOpened(arg.map((recent: IRecent) => {
                if (isRecentFile(recent)) {
                    recent.fileUri = URI.revive(recent.fileUri);
                } else if (isRecentFolder(recent)) {
                    recent.folderUri = URI.revive(recent.folderUri);
                } else {
                    recent.workspace = reviveWorkspaceIdentifier(recent.workspace);
                }
                return recent;
            }));
            case 'removeFromRecentlyOpened': return this.service.removeFromRecentlyOpened(arg.map(URI.revive));
            case 'clearRecentlyOpened': return this.service.clearRecentlyOpened();
            case 'newWindowTab': return this.service.newWindowTab();
            case 'showPreviousWindowTab': return this.service.showPreviousWindowTab();
            case 'showNextWindowTab': return this.service.showNextWindowTab();
            case 'moveWindowTabToNewWindow': return this.service.moveWindowTabToNewWindow();
            case 'mergeAllWindowTabs': return this.service.mergeAllWindowTabs();
            case 'toggleWindowTabsBar': return this.service.toggleWindowTabsBar();
            case 'updateTouchBar': return this.service.updateTouchBar(arg[0], arg[1]);
            case 'getRecentlyOpened': return this.service.getRecentlyOpened(arg);
            case 'focusWindow': return this.service.focusWindow(arg);
            case 'closeWindow': return this.service.closeWindow(arg);
            case 'isFocused': return this.service.isFocused(arg);
            case 'isMaximized': return this.service.isMaximized(arg);
            case 'maximizeWindow': return this.service.maximizeWindow(arg);
            case 'unmaximizeWindow': return this.service.unmaximizeWindow(arg);
            case 'minimizeWindow': return this.service.minimizeWindow(arg);
            case 'onWindowTitleDoubleClick': return this.service.onWindowTitleDoubleClick(arg);
            case 'setDocumentEdited': return this.service.setDocumentEdited(arg[0], arg[1]);
            case 'openWindow': {
                const urisToOpen: IURIToOpen[] = arg[1];
                const options: IOpenSettings = arg[2];
                urisToOpen.forEach(r => {
                    if (isWorkspaceToOpen(r)) {
                        r.workspaceUri = URI.revive(r.workspaceUri);
                    } else if (isFolderToOpen(r)) {
                        r.folderUri = URI.revive(r.folderUri);
                    } else {
                        r.fileUri = URI.revive(r.fileUri);
                    }
                });
                options.waitMarkerFileURI = options.waitMarkerFileURI && URI.revive(options.waitMarkerFileURI);
                return this.service.openWindow(arg[0], urisToOpen, options);
            }
            case 'openNewWindow': return this.service.openNewWindow(arg);
            case 'getWindows': return this.service.getWindows();
            case 'getWindowCount': return this.service.getWindowCount();
            case 'relaunch': return this.service.relaunch(arg[0]);
            case 'whenSharedProcessReady': return this.service.whenSharedProcessReady();
            case 'toggleSharedProcess': return this.service.toggleSharedProcess();
            case 'quit': return this.service.quit();
            case 'log': return this.service.log(arg[0], arg[1]);
            case 'showItemInFolder': return this.service.showItemInFolder(URI.revive(arg));
            case 'getActiveWindowId': return this.service.getActiveWindowId();
            case 'openExternal': return this.service.openExternal(arg);
            case 'startCrashReporter': return this.service.startCrashReporter(arg);
            case 'openAboutDialog': return this.service.openAboutDialog();
            case 'resolveProxy': return this.service.resolveProxy(arg[0], arg[1]);
        }

        throw new Error(`Call not found: ${command}`);
    }
開發者ID:PKRoma,項目名稱:vscode,代碼行數:78,代碼來源:windowsIpc.ts

示例5:

    run() {
        return this.windowsService.openExternal(this.path);
    }
開發者ID:burhandodhy,項目名稱:azuredatastudio,代碼行數:3,代碼來源:workspaceActions.ts


注:本文中的vs/platform/windows/common/windows.IWindowsService類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。