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


TypeScript remote.BrowserWindow.getAllWindows方法代碼示例

本文整理匯總了TypeScript中electron.remote.BrowserWindow.getAllWindows方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript remote.BrowserWindow.getAllWindows方法的具體用法?TypeScript remote.BrowserWindow.getAllWindows怎麽用?TypeScript remote.BrowserWindow.getAllWindows使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在electron.remote.BrowserWindow的用法示例。


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

示例1: Notification

services.jobs.onFinish.subscribe(job => {
    const electronWindow = remote.BrowserWindow.getAllWindows()[0];

    if (remote.app.dock && !electronWindow.isFocused()) {
        remote.app.dock.bounce("informational");
        remote.app.dock.setBadge(job.status === Status.Success ? "1" : "✕");

        const title = job.status === Status.Success ? "Completed" : "Failed";

        /* tslint:disable:no-unused-expression */
        new Notification(title, {body: job.prompt.value});
    }
});
開發者ID:sunyton,項目名稱:upterm,代碼行數:13,代碼來源:JobFinishedNotifications.ts

示例2: sanitizeFilename

 r.onloadend = () => {
   const data = {
     name: sanitizeFilename(self.visState.title.toLowerCase().replace(/\s/g, '-')),
     image: r.result,
     format: 'png'
   };
   remote.dialog.showSaveDialog(
     remote.BrowserWindow.getAllWindows()[0],
     {
       title: 'Export to Image',
       defaultPath: sanitizeFilename(data.name + '.' + data.format)
     },
     (name: string) => {
       name && writeFileSync(name, arrayBufferToBuffer(data.image));
     }
   );
 };
開發者ID:chauey,項目名稱:ngrev,代碼行數:17,代碼來源:export-to-image.service.ts

示例3: getData

function getData(): [Electron.BrowserWindow, MessageServerChannel<'log'>] {
	let win: Electron.BrowserWindow = null;
	if (!BrowserWindow) {
		win = remote.BrowserWindow.getAllWindows()[0];
	} else {
		win = BrowserWindow.getAllWindows()[0];
	}

	if (!logChannel && win) {
		logChannel = new MessageServer({
			activeWindow: win,
			activeWindowPromise: new Promise((resolve) => {
				resolve(win);
			}),
			idGenerator: -1
		}).channel('log');
	}

	return [win, logChannel];
}
開發者ID:SanderRonde,項目名稱:youtube-music-app,代碼行數:20,代碼來源:log.ts

示例4: isInProgress

            if (isKeybindingForEvent(event, KeyboardAction.cliHistoryPrevious)) {
                prompt.setPreviousHistoryItem();

                event.stopPropagation();
                event.preventDefault();
                return;
            }

            if (isKeybindingForEvent(event, KeyboardAction.cliHistoryNext)) {
                prompt.setNextHistoryItem();

                event.stopPropagation();
                event.preventDefault();
                return;
            }
        }
    }

    prompt.setPreviousKeyCode(event);
};

function isInProgress(job: JobComponent): boolean {
    return job.props.job.status === Status.InProgress;
}

const app = remote.app;
const browserWindow = remote.BrowserWindow.getAllWindows()[0];
const template = buildMenuTemplate(app, browserWindow);

remote.Menu.setApplicationMenu(remote.Menu.buildFromTemplate(template));
開發者ID:fabricionaweb,項目名稱:black-screen,代碼行數:30,代碼來源:UserEventsHander.ts


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