Пример #1
0
        private void WorkerOnStatusChanged(INotifyThreadStatus sender, StatusChangedEventArgs args)
        {
            if (args.AttachedData?.guid != Guid ?? false)
            {
                return;
            }

            _worker.StatusChanged -= WorkerOnStatusChanged;

            _database.SetZipFileLocation(Guid, args.AttachedData.destinationPath);

            WebFileLocation = args.AttachedData.destinationPath;

            string userstory = null, exception;

            using (ZipArchive archive = new ZipArchive(File.OpenRead(args.AttachedData.destinationPath), ZipArchiveMode.Read, false))
            {
                ZipArchiveEntry userstoryEntry = archive.GetEntry("userstory.txt");
                if (userstoryEntry != null)
                {
                    using (Stream s = userstoryEntry.Open())
                    {
                        byte[] buffer = new byte[userstoryEntry.Length];
                        s.Read(buffer, 0, buffer.Length);
                        userstory = Encoding.UTF8.GetString(buffer);
                    }
                }

                ZipArchiveEntry exceptionEntry = archive.GetEntry("exception.txt");
                using (Stream s = exceptionEntry.Open())
                {
                    byte[] buffer = new byte[exceptionEntry.Length];
                    s.Read(buffer, 0, buffer.Length);
                    exception = Encoding.UTF8.GetString(buffer);
                }
            }
            Userstory  = userstory;
            StackTrace = exception;

            _database.SetStackTrace(Guid, exception);
            if (userstory != null)
            {
                _database.SetUserStory(Guid, userstory);
            }


            Progress = CrashReportProcessingProgress.Downloaded;
        }
Пример #2
0
 private void OnStatusChanged(StatusChangedEventArgs args)
 {
     StatusChanged?.Invoke(this, args);
 }
Пример #3
0
 protected virtual void OnStatusChanged(StatusChangedEventArgs args)
 {
     StatusChanged?.Invoke(this, args);
 }