protected override void finish()
        {
            base.finish();

            if (IsCanceled && !IsCompleted && OperationResult == null)
            {
                OperationResult = new OperationResult(true);
            }
        }
        private OperationResult deviceTransaction()
        {
            var result = new OperationResult(false);
            var taskResult = false;

            try
            {
                if (isWriteMode)
                {
                    device.AssertIsWritable();

                    device.AcquireLock();
                }

                taskResult = workOnDevice();

                if (isWriteMode)
                {
                    device.SaveChanges();
                }
            }
            catch (BaseSharePodLibException e)
            {
                result = new OperationResult(e);
            }
            finally
            {
                if (isWriteMode)
                {
                    device.ReleaseLock();
                }
            }

            // ???
            if (isWriteMode)
                device.Refresh();

            if (!taskResult)
                result = new OperationResult(true);

            return result;
        }
        protected override bool work()
        {
            OperationResult = deviceTransaction();

            return !OperationResult.IsFailed;
        }
        protected JobResult processResult(OperationResult or, bool isSilent, IList<FarFile> fileToStay = null)
        {
            IList<FarFile> notProcessedFiles = or.ResultData as IList<FarFile>;

            if (notProcessedFiles != null && fileToStay != null)
                foreach (var ff in notProcessedFiles) fileToStay.Add(ff);

            if (!isSilent && !string.IsNullOrEmpty(or.Message))
                Far.Net.Message(or.Message, MsgStr.FarPod, MsgOptions.Warning);

            if (notProcessedFiles != null)
            {
                return JobResult.Incomplete;
            }
            else if (or.IsFailed)
            {
                return JobResult.Ignore;
            }
            else
            {
                return JobResult.Done;
            }
        }