本文整理汇总了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});
}
});
示例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));
}
);
};
示例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];
}
示例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));