本文整理汇总了TypeScript中vs/workbench/services/message/browser/messagelist/messageList.MessageList类的典型用法代码示例。如果您正苦于以下问题:TypeScript MessageList类的具体用法?TypeScript MessageList怎么用?TypeScript MessageList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MessageList类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: resume
public resume(): void {
this.canShowMessages = true;
this.handler.show();
// Release messages from buffer
while (this.messageBuffer.length) {
const bufferedMessage = this.messageBuffer.pop();
bufferedMessage.disposeFn = this.show(bufferedMessage.severity, bufferedMessage.message, bufferedMessage.onHide);
}
}
示例2: doShow
private doShow(sev: Severity, message: any): () => void {
// Check flag if we can show a message now
if (!this.canShowMessages) {
const messageObj: IBufferedMessage = { severity: sev, message, disposeFn: () => this.messageBuffer.splice(this.messageBuffer.indexOf(messageObj), 1) };
this.messageBuffer.push(messageObj);
// Return function that allows to remove message from buffer
return () => messageObj.disposeFn();
}
// Show in Console
if (sev === Severity.Error) {
console.error(toErrorMessage(message, true));
}
// Show in Global Handler
return this.handler.showMessage(this.toBaseSeverity(sev), message);
}
示例3: suspend
public suspend(): void {
this.canShowMessages = false;
this.handler.hide();
}
示例4: hideAll
public hideAll(): void {
if (this.handler) {
this.handler.hideMessages();
}
}