Beispiel #1
0
        public FileOperationResult GetResult()
        {
            var r = new FileOperationResult()
            {
                Id                                                                   = this.Id.ToString(),
                OperationType                                                        = this.OperationType,
                Progress                                                             = (int)this.Percentage,
                Source                                                               = this.Source != null?this.Source.ToString().Trim() : null,
                                                      Result                         = this.Status != null?this.Status.ToString().Trim() : null,
                                                                               Error = this.Error != null?Error.ToString() : null,
                                                                                           Processed = processed.ToString(),
            };

#if !DEBUG
            var error = Error as Exception;
            if (error != null)
            {
                if (error is System.IO.IOException)
                {
                    r.Error = FilesCommonResource.ErrorMassage_FileNotFound;
                }
                else
                {
                    r.Error = error.Message;
                }
            }
#endif
            return(r);
        }
Beispiel #2
0
        public FileOperationResult GetResult()
        {
            var r = new FileOperationResult()
                        {
                            Id = this.Id.ToString(),
                            OperationType = this.OperationType,
                            Progress = (int) this.Percentage,
                            Source = this.Source != null ? this.Source.ToString().Trim() : null,
                            Result = this.Status != null ? this.Status.ToString().Trim() : null,
                            Error = this.Error != null ? Error.ToString() : null,
                            Processed = processed.ToString(),
                        };
#if !DEBUG
            var error = Error as Exception;
            if (error != null)
            {
                if (error is System.IO.IOException)
                {
                    r.Error = FilesCommonResource.ErrorMassage_FileNotFound;
                }
                else
                {
                    r.Error = error.Message;
                }
            }
#endif
            return r;
        }