protected internal override void OnRecoverAgreed(ConversationRecoverAgreedMessage recoverResponseMessage)
        {
            //修改holder获取已经有进度的Item,seek到进度位置。其它的全都seek到0,然后重新Post holder.
            var sendItemRecoverResponse = recoverResponseMessage as RecoverSendItemsResponse;

            if (sendItemRecoverResponse == null)
            {
                return;
            }
            var items = sendItemRecoverResponse.Items;

            //因为所有的item,都是传输完毕确认之后才删除的,所以只要检查已有item即可。
            holder.Items.ForEach((localItem) =>
            {
                if (localItem is ISeekable)
                {
                    var localSeekable = localItem as ISeekable;
                    var result        = items.Find(i => i.ID == localItem.ID);
                    //TODO 文件夹怎么处理?还需要再想想。文件夹能Seek吗?不应该吧?
                    if (result == null)
                    {
                        localSeekable.SeekTo(0);
                    }
                    else
                    {
                        localSeekable.SeekTo(result.TransferredLength);
                    }
                }
            });
            PostAsSendable(holder);
        }
Exemplo n.º 2
0
 internal protected virtual void OnRecoverAgreed(ConversationRecoverAgreedMessage recoverResponseMessage)
 {
 }
 protected internal override void OnRecoverAgreed(ConversationRecoverAgreedMessage recoverResponseMessage)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 4
0
 protected internal override void OnRecoverAgreed(ConversationRecoverAgreedMessage recoverResponseMessage)
 {
     //不需要做什么,对方会根据恢复时各个Item的位置,继续发消息过来
 }