ResumeMonitoringAsync

ImapClient.ResumeMonitoringAsync method

恢复监视指定文件夹的消息更改。 与 StartMonitoring 方法不同,它将查找所有丢失的邮箱更改并为它们调用 回调。

public Task ResumeMonitoringAsync(ImapMonitoringEventHandler callback, 
    ImapMonitoringErrorEventHandler errorCallback, IImapMonitoringState monitoringState, 
    CancellationToken token = default)
范围类型描述
callbackImapMonitoringEventHandler监控操作的回调函数。
errorCallbackImapMonitoringErrorEventHandler用于监控错误处理的回调函数。 调用此回调时停止对指定文件夹的监控。 回调还提供了一个状态持有者,因此可以恢复文件夹监控 使用ResumeMonitoringAsync方法.
monitoringStateIImapMonitoringState恢复文件夹监视的监视状态。 可以从中检索MonitoringState.
tokenCancellationToken取消令牌

也可以看看