本文整理汇总了TypeScript中vs/base/common/async.RunOnceScheduler.cancel方法的典型用法代码示例。如果您正苦于以下问题:TypeScript RunOnceScheduler.cancel方法的具体用法?TypeScript RunOnceScheduler.cancel怎么用?TypeScript RunOnceScheduler.cancel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vs/base/common/async.RunOnceScheduler
的用法示例。
在下文中一共展示了RunOnceScheduler.cancel方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: show
show(delay?: number): void {
this.showDelayedScheduler.cancel();
if (typeof delay === 'number') {
this.showDelayedScheduler.schedule(delay);
} else {
show(this.element);
}
}
示例2: cancel
public cancel(): void {
this._loadingMessageScheduler.cancel();
if (this._state === ComputeHoverOperationState.FIRST_WAIT) {
this._firstWaitScheduler.cancel();
}
if (this._state === ComputeHoverOperationState.SECOND_WAIT) {
this._secondWaitScheduler.cancel();
if (this._asyncComputationPromise) {
this._asyncComputationPromise.cancel();
this._asyncComputationPromise = null;
}
}
if (this._state === ComputeHoverOperationState.WAITING_FOR_ASYNC_COMPUTATION) {
if (this._asyncComputationPromise) {
this._asyncComputationPromise.cancel();
this._asyncComputationPromise = null;
}
}
this._state = ComputeHoverOperationState.IDLE;
}
示例3: start
public start(mode: HoverStartMode): void {
if (mode === HoverStartMode.Delayed) {
if (this._state === ComputeHoverOperationState.IDLE) {
this._state = ComputeHoverOperationState.FIRST_WAIT;
this._firstWaitScheduler.schedule(this._firstWaitTime());
this._loadingMessageScheduler.schedule(this._loadingMessageTime());
}
} else {
switch (this._state) {
case ComputeHoverOperationState.IDLE:
this._triggerAsyncComputation();
this._secondWaitScheduler.cancel();
this._triggerSyncComputation();
break;
case ComputeHoverOperationState.SECOND_WAIT:
this._secondWaitScheduler.cancel();
this._triggerSyncComputation();
break;
}
}
}
示例4: hide
hide(): void {
hide(this.element);
this.showDelayedScheduler.cancel();
}