Ejemplo n.º 1
0
        /// <summary>
        /// Callback method to be used as the ImapCommand's ContinuationHandler.
        /// </summary>
        /// <remarks>
        /// Callback method to be used as the ImapCommand's ContinuationHandler.
        /// </remarks>
        /// <param name="engine">The ImapEngine.</param>
        /// <param name="ic">The ImapCommand.</param>
        /// <param name="text">The text.</param>
        /// <param name="doAsync"><c>true</c> if the command is being run asynchronously; otherwise, <c>false</c>.</param>
        /// <returns></returns>
        public Task ContinuationHandler(ImapEngine engine, ImapCommand ic, string text, bool doAsync)
        {
            Engine.State = ImapEngineState.Idle;

            registration = DoneToken.Register(IdleComplete);

            return(Task.FromResult(true));
        }
 private void HandleDoneToken(DoneToken token)
 {
     if (_hasFormatted)
     {
         ReturnCurrent();
         _hasFormatted = false;
     }
     else if ((token.Status & DoneToken.DoneStatus.TDS_DONE_COUNT) == DoneToken.DoneStatus.TDS_DONE_COUNT)
     {
         _runningTotalRecordsAffected += token.Count;
         _dataReader.SetRecordsAffected(_runningTotalRecordsAffected);
     }
     if ((token.Status & DoneToken.DoneStatus.TDS_DONE_MORE) == DoneToken.DoneStatus.TDS_DONE_FINAL)
     {
         ReturnCurrent();
     }
 }