本文整理匯總了TypeScript中vs/workbench/services/message/browser/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, onHide?: () => void): () => void {
// Check flag if we can show a message now
if (!this.canShowMessages) {
const messageObj: IBufferedMessage = {
severity: sev,
message,
onHide,
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, onHide);
}
示例3: suspend
public suspend(): void {
this.canShowMessages = false;
this.handler.hide();
}
示例4: hideAll
public hideAll(): void {
if (this.handler) {
this.handler.hideMessages();
}
}