本文整理汇总了C#中MailKit.Net.Imap.ImapCommand.Step方法的典型用法代码示例。如果您正苦于以下问题:C# ImapCommand.Step方法的具体用法?C# ImapCommand.Step怎么用?C# ImapCommand.Step使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MailKit.Net.Imap.ImapCommand
的用法示例。
在下文中一共展示了ImapCommand.Step方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Iterate
/// <summary>
/// Iterate the command pipeline.
/// </summary>
public int Iterate()
{
if (stream == null)
throw new InvalidOperationException ();
if (queue.Count == 0)
return 0;
current = queue[0];
queue.RemoveAt (0);
try {
current.CancellationToken.ThrowIfCancellationRequested ();
} catch (OperationCanceledException) {
// FIXME: is this right??
queue.RemoveAll (x => x.CancellationToken == current.CancellationToken);
throw;
}
current.Status = ImapCommandStatus.Active;
try {
while (current.Step ()) {
// more literal data to send...
}
if (current.Bye)
Disconnect ();
} catch {
Disconnect ();
throw;
}
return current.Id;
}
示例2: Iterate
/// <summary>
/// Iterate the command pipeline.
/// </summary>
public int Iterate()
{
if (Stream == null)
throw new InvalidOperationException ();
if (queue.Count == 0)
return 0;
current = queue[0];
queue.RemoveAt (0);
try {
current.CancellationToken.ThrowIfCancellationRequested ();
} catch {
queue.RemoveAll (x => x.CancellationToken.IsCancellationRequested);
current = null;
throw;
}
current.Status = ImapCommandStatus.Active;
int id = current.Id;
try {
while (current.Step ()) {
// more literal data to send...
}
if (current.Bye)
Disconnect ();
} catch {
Disconnect ();
throw;
} finally {
current = null;
}
return id;
}