Changeset 2737
- Timestamp:
- 6/29/2012 10:22:26 AM (11 months ago)
- Location:
- branches/eraser6/EraserService
- Files:
-
- 60 edited
- 6 copied
-
. (modified) (1 prop)
-
Eraser.BlackBox/BlackBox.cs (modified) (3 diffs)
-
Eraser.BlackBox/BlackBoxClientTool.cs (copied) (copied from trunk/eraser/Eraser.BlackBox/BlackBoxClientTool.cs)
-
Eraser.BlackBox/BlackBoxMainForm.Designer.cs (modified) (6 diffs)
-
Eraser.BlackBox/BlackBoxMainForm.cs (modified) (5 diffs)
-
Eraser.BlackBox/BlackBoxMainForm.resx (modified) (16 diffs)
-
Eraser.BlackBox/BlackBoxNotifier.cs (copied) (copied from trunk/eraser/Eraser.BlackBox/BlackBoxNotifier.cs)
-
Eraser.BlackBox/BlackBoxReport.cs (copied) (copied from trunk/eraser/Eraser.BlackBox/BlackBoxReport.cs)
-
Eraser.BlackBox/BlackBoxReportUploader.cs (copied) (copied from trunk/eraser/Eraser.BlackBox/BlackBoxReportUploader.cs)
-
Eraser.BlackBox/BlackBoxUploadForm.Designer.cs (modified) (1 diff)
-
Eraser.BlackBox/BlackBoxUploadForm.cs (modified) (1 diff)
-
Eraser.BlackBox/BlackBoxUploadForm.it.resx (modified) (1 diff)
-
Eraser.BlackBox/BlackBoxUploadForm.resx (modified) (2 diffs)
-
Eraser.BlackBox/Eraser.BlackBox.csproj (modified) (3 diffs)
-
Eraser.BlackBox/Plugin.cs (modified) (2 diffs)
-
Eraser.BlackBox/Strings.en.resx (modified) (2 diffs)
-
Eraser.BlackBox/Strings.it.resx (modified) (2 diffs)
-
Eraser.BlackBox/Strings.nl.resx (modified) (2 diffs)
-
Eraser.BlackBox/Strings.pl.resx (modified) (2 diffs)
-
Eraser.BlackBox/Strings.resx (modified) (2 diffs)
-
Eraser.DefaultPlugins/EntropySources/KernelEntropySource.cs (modified) (2 diffs)
-
Eraser.DefaultPlugins/ErasureTargets/DriveErasureTarget.cs (modified) (1 diff)
-
Eraser.DefaultPlugins/ErasureTargets/DriveErasureTargetConfigurer.cs (modified) (1 diff)
-
Eraser.DefaultPlugins/ErasureTargets/FileErasureTarget.cs (modified) (1 diff)
-
Eraser.DefaultPlugins/ErasureTargets/FileSystemObjectErasureTarget.cs (modified) (8 diffs)
-
Eraser.DefaultPlugins/ErasureTargets/FolderErasureTarget.cs (modified) (2 diffs)
-
Eraser.DefaultPlugins/ErasureTargets/RecycleBinErasureTarget.cs (modified) (1 diff)
-
Eraser.DefaultPlugins/ErasureTargets/SecureMoveErasureTarget.cs (modified) (1 diff)
-
Eraser.DefaultPlugins/FileSystems/Fat.cs (modified) (3 diffs)
-
Eraser.DefaultPlugins/FileSystems/Windows.cs (modified) (2 diffs)
-
Eraser.DefaultPlugins/Strings.en.resx (modified) (5 diffs)
-
Eraser.DefaultPlugins/Strings.it.resx (modified) (5 diffs)
-
Eraser.DefaultPlugins/Strings.nl.resx (modified) (5 diffs)
-
Eraser.DefaultPlugins/Strings.pl.resx (modified) (4 diffs)
-
Eraser.DefaultPlugins/Strings.resx (modified) (5 diffs)
-
Eraser.Manager/Strings.en.resx (modified) (1 diff)
-
Eraser.Manager/Task.cs (modified) (1 diff)
-
Eraser.Plugins/Eraser.Plugins.csproj (modified) (2 diffs)
-
Eraser.Plugins/ExtensionPoints/INotifier.cs (copied) (copied from trunk/eraser/Eraser.Plugins/ExtensionPoints/INotifier.cs)
-
Eraser.Plugins/Host.cs (modified) (3 diffs)
-
Eraser.Plugins/Registrars/FileSystemRegistrar.cs (modified) (1 diff)
-
Eraser.Plugins/Registrars/NotifierRegistrar.cs (copied) (copied from trunk/eraser/Eraser.Plugins/Registrars/NotifierRegistrar.cs)
-
Eraser.Shell/CtxMenu.cpp (modified) (1 diff)
-
Eraser.Shell/CtxMenu.h (modified) (1 diff)
-
Eraser.Util.Native/Fat12Or16Api.cpp (modified) (2 diffs)
-
Eraser.Util.Native/Fat32Api.cpp (modified) (1 diff)
-
Eraser.Util.Native/FatApi.cpp (modified) (2 diffs)
-
Eraser.Util.Native/FatApi.h (modified) (7 diffs)
-
Eraser.Util.Native/OpenHandle.cpp (modified) (1 diff)
-
Eraser.Util/ExtensionClasses/SharingViolationException.cs (modified) (1 diff)
-
Eraser.Util/PostDataBuilder.cs (modified) (1 diff)
-
Eraser.Util/Strings.en.resx (modified) (1 diff)
-
Eraser.Util/VolumeInfo.cs (modified) (3 diffs)
-
Eraser.Util/Win32ErrorCodes.cs (modified) (2 diffs)
-
Eraser/MainForm.Designer.cs (modified) (7 diffs)
-
Eraser/MainForm.cs (modified) (4 diffs)
-
Eraser/MainForm.resx (modified) (4 diffs)
-
Eraser/Program.ConsoleProgram.cs (modified) (1 diff)
-
Eraser/Program.GuiProgram.cs (modified) (1 diff)
-
Eraser/Program.cs (modified) (2 diffs)
-
Eraser/Strings.en.resx (modified) (5 diffs)
-
Eraser/Strings.it.resx (modified) (2 diffs)
-
Eraser/Strings.nl.resx (modified) (2 diffs)
-
Eraser/Strings.pl.resx (modified) (2 diffs)
-
Eraser/Strings.resx (modified) (2 diffs)
-
Eraser/UpdateForm.cs (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eraser6/EraserService
- Property svn:mergeinfo changed
/branches/eraser6/6.0 merged: 2720-2721,2724,2727-2728,2731 /trunk/eraser (added) merged: 2632,2634-2647,2653-2662,2667-2683,2696-2701,2703-2715,2722,2725-2726,2729-2730,2732-2734
- Property svn:mergeinfo changed
-
branches/eraser6/EraserService/Eraser.BlackBox/BlackBox.cs
r2621 r2737 26 26 using System.Windows.Forms; 27 27 using System.IO; 28 using System.Runtime.InteropServices;29 28 using System.Diagnostics; 30 29 using System.Reflection; … … 32 31 using System.Drawing; 33 32 using System.Drawing.Imaging; 34 using System.Collections.ObjectModel;35 33 using System.Globalization; 36 34 37 using System.Net;38 using System.Xml;39 35 using System.ComponentModel; 40 36 41 using SevenZip;42 using SevenZip.Compression.LZMA;43 using ICSharpCode.SharpZipLib.Tar;44 using ICSharpCode.SharpZipLib.BZip2;45 using Microsoft.Win32.SafeHandles;46 37 using Microsoft.VisualBasic.Devices; 47 38 48 39 using Eraser.Util; 49 40 using Eraser.Util.ExtensionMethods; 50 using Eraser.Plugins;51 using ProgressChangedEventHandler = Eraser.Plugins.ProgressChangedEventHandler;52 using ProgressChangedEventArgs = Eraser.Plugins.ProgressChangedEventArgs;53 41 54 42 namespace Eraser.BlackBox … … 370 358 internal static readonly string ScreenshotFileName = "Screenshot.png"; 371 359 } 372 373 /// <summary>374 /// Represents one BlackBox crash report.375 /// </summary>376 public class BlackBoxReport377 {378 /// <summary>379 /// Constructor.380 /// </summary>381 /// <param name="path">Path to the folder containing the memory dump, screenshot and382 /// debug log.</param>383 internal BlackBoxReport(string path)384 {385 Path = path;386 387 string stackTracePath = System.IO.Path.Combine(Path, StackTraceFileName);388 if (!File.Exists(stackTracePath))389 {390 Delete();391 throw new InvalidDataException("The BlackBox report is corrupt.");392 }393 394 string[] stackTrace = null;395 using (StreamReader reader = new StreamReader(stackTracePath))396 stackTrace = reader.ReadToEnd().Split(new char[] { '\n' });397 398 //Parse the lines in the file.399 StackTraceCache = new List<BlackBoxExceptionEntry>();400 List<string> currentException = new List<string>();401 string exceptionType = null;402 foreach (string str in stackTrace)403 {404 if (str.StartsWith("Exception "))405 {406 //Add the current exception to the list of exceptions.407 if (currentException.Count != 0)408 {409 StackTraceCache.Add(new BlackBoxExceptionEntry(exceptionType,410 new List<string>(currentException)));411 currentException.Clear();412 }413 414 //Set the exception type for the next exception.415 exceptionType = str.Substring(str.IndexOf(':') + 1).Trim();416 }417 else if (!string.IsNullOrEmpty(str.Trim()))418 {419 currentException.Add(str.Trim());420 }421 }422 423 if (currentException.Count != 0)424 StackTraceCache.Add(new BlackBoxExceptionEntry(exceptionType, currentException));425 }426 427 /// <summary>428 /// Deletes the report and its contents.429 /// </summary>430 public void Delete()431 {432 Directory.Delete(Path, true);433 }434 435 /// <summary>436 /// The name of the report.437 /// </summary>438 public string Name439 {440 get441 {442 return System.IO.Path.GetFileName(Path);443 }444 }445 446 /// <summary>447 /// The timestamp of the report.448 /// </summary>449 public DateTime Timestamp450 {451 get452 {453 try454 {455 return DateTime.ParseExact(Name, BlackBox.CrashReportName,456 CultureInfo.InvariantCulture).ToLocalTime();457 }458 catch (FormatException)459 {460 return DateTime.MinValue;461 }462 }463 }464 465 /// <summary>466 /// The path to the folder containing the report.467 /// </summary>468 public string Path469 {470 get;471 private set;472 }473 474 /// <summary>475 /// The files which comprise the error report.476 /// </summary>477 public ReadOnlyCollection<FileInfo> Files478 {479 get480 {481 List<FileInfo> result = new List<FileInfo>();482 DirectoryInfo directory = new DirectoryInfo(Path);483 foreach (FileInfo file in directory.GetFiles())484 if (!InternalFiles.Contains(file.Name))485 result.Add(file);486 487 return result.AsReadOnly();488 }489 }490 491 /// <summary>492 /// Gets a read-only stream which reads the Debug log.493 /// </summary>494 public Stream DebugLog495 {496 get497 {498 return new FileStream(System.IO.Path.Combine(Path, BlackBox.DebugLogFileName),499 FileMode.Open, FileAccess.Read, FileShare.Read);500 }501 }502 503 /// <summary>504 /// Gets the stack trace for this crash report.505 /// </summary>506 public ReadOnlyCollection<BlackBoxExceptionEntry> StackTrace507 {508 get509 {510 return StackTraceCache.AsReadOnly();511 }512 }513 514 /// <summary>515 /// Gets or sets whether the given report has been uploaded to the server.516 /// </summary>517 public bool Submitted518 {519 get520 {521 byte[] buffer = new byte[1];522 using (FileStream stream = new FileStream(System.IO.Path.Combine(Path, StatusFileName),523 FileMode.OpenOrCreate, FileAccess.Read, FileShare.Read))524 {525 stream.Read(buffer, 0, buffer.Length);526 }527 528 return buffer[0] == 1;529 }530 531 set532 {533 byte[] buffer = { Convert.ToByte(value) };534 using (FileStream stream = new FileStream(System.IO.Path.Combine(Path, StatusFileName),535 FileMode.OpenOrCreate, FileAccess.Write, FileShare.Read))536 {537 stream.Write(buffer, 0, buffer.Length);538 }539 }540 }541 542 public override string ToString()543 {544 return Name;545 }546 547 /// <summary>548 /// The backing variable for the <see cref="StackTrace"/> field.549 /// </summary>550 private List<BlackBoxExceptionEntry> StackTraceCache;551 552 /// <summary>553 /// The file name for the status file.554 /// </summary>555 private static readonly string StatusFileName = "Status.txt";556 557 /// <summary>558 /// The file name of the stack trace.559 /// </summary>560 internal static readonly string StackTraceFileName = "Stack Trace.log";561 562 /// <summary>563 /// The list of files internal to the report.564 /// </summary>565 private static readonly List<string> InternalFiles = new List<string>(566 new string[] {567 StackTraceFileName,568 StatusFileName569 }570 );571 }572 573 /// <summary>574 /// Represents one exception which can be chained <see cref="InnerException"/>575 /// to represent the exception handled by BlackBox576 /// </summary>577 public class BlackBoxExceptionEntry578 {579 /// <summary>580 /// Constructor.581 /// </summary>582 /// <param name="exceptionType">The type of the exception.</param>583 /// <param name="stackTrace">The stack trace for this exception.</param>584 internal BlackBoxExceptionEntry(string exceptionType, List<string> stackTrace)585 {586 ExceptionType = exceptionType;587 StackTraceCache = stackTrace;588 }589 590 /// <summary>591 /// The type of the exception.592 /// </summary>593 public string ExceptionType594 {595 get;596 private set;597 }598 599 /// <summary>600 /// The stack trace for this exception.601 /// </summary>602 public ReadOnlyCollection<string> StackTrace603 {604 get605 {606 return StackTraceCache.AsReadOnly();607 }608 }609 610 /// <summary>611 /// The backing variable for the <see cref="StackTrace"/> property.612 /// </summary>613 private List<string> StackTraceCache;614 }615 616 /// <summary>617 /// Uploads <see cref="BlackBoxReport"/>s to the Eraser server.618 /// </summary>619 public class BlackBoxReportUploader620 {621 private class SevenZipProgressCallback : ICodeProgress622 {623 public SevenZipProgressCallback(BlackBoxReportUploader uploader,624 SteppedProgressManager progress, ProgressManager stepProgress,625 ProgressChangedEventHandler progressChanged)626 {627 Uploader = uploader;628 Progress = progress;629 StepProgress = stepProgress;630 EventHandler = progressChanged;631 }632 633 #region ICodeProgress Members634 635 public void SetProgress(long inSize, long outSize)636 {637 StepProgress.Completed = inSize;638 EventHandler(Uploader, new ProgressChangedEventArgs(Progress, null));639 }640 641 #endregion642 643 private BlackBoxReportUploader Uploader;644 private SteppedProgressManager Progress;645 private ProgressManager StepProgress;646 private ProgressChangedEventHandler EventHandler;647 }648 649 /// <summary>650 /// Constructor.651 /// </summary>652 /// <param name="report">The report to upload.</param>653 public BlackBoxReportUploader(BlackBoxReport report)654 {655 Report = report;656 if (!Directory.Exists(UploadTempDir))657 Directory.CreateDirectory(UploadTempDir);658 659 ReportBaseName = Path.Combine(UploadTempDir, Report.Name);660 }661 662 /// <summary>663 /// Gets from the server based on the stack trace whether this report is664 /// new.665 /// </summary>666 public bool IsNew667 {668 get669 {670 PostDataBuilder builder = new PostDataBuilder();671 builder.AddPart(new PostDataField("action", "status"));672 AddStackTraceToRequest(Report.StackTrace, builder);673 674 WebRequest reportRequest = HttpWebRequest.Create(BlackBoxServer);675 reportRequest.ContentType = builder.ContentType;676 reportRequest.Method = "POST";677 using (Stream formStream = builder.Stream)678 {679 reportRequest.ContentLength = formStream.Length;680 using (Stream requestStream = reportRequest.GetRequestStream())681 {682 int lastRead = 0;683 byte[] buffer = new byte[32768];684 while ((lastRead = formStream.Read(buffer, 0, buffer.Length)) != 0)685 requestStream.Write(buffer, 0, lastRead);686 }687 }688 689 try690 {691 HttpWebResponse response = reportRequest.GetResponse() as HttpWebResponse;692 using (Stream responseStream = response.GetResponseStream())693 {694 XmlReader reader = XmlReader.Create(responseStream);695 reader.ReadToFollowing("crashReport");696 string reportStatus = reader.GetAttribute("status");697 switch (reportStatus)698 {699 case "exists":700 Report.Submitted = true;701 return false;702 703 case "new":704 return true;705 706 default:707 throw new InvalidDataException(708 "Unknown crash report server response.");709 }710 }711 }712 catch (WebException e)713 {714 if (e.Response == null)715 throw;716 717 using (Stream responseStream = e.Response.GetResponseStream())718 {719 try720 {721 XmlReader reader = XmlReader.Create(responseStream);722 reader.ReadToFollowing("error");723 throw new InvalidDataException(string.Format(CultureInfo.CurrentCulture,724 "The server encountered a problem while processing the request: {0}",725 reader.ReadString()));726 }727 catch (XmlException)728 {729 }730 }731 732 throw new InvalidDataException(((HttpWebResponse)e.Response).StatusDescription);733 }734 }735 }736 737 /// <summary>738 /// Compresses the report for uploading.739 /// </summary>740 /// <param name="progress">The <see cref="ProgressManager"/> instance that the741 /// Upload function is using.</param>742 /// <param name="progressChanged">The progress changed event handler that should743 /// be called for upload progress updates.</param>744 private void Compress(SteppedProgressManager progress,745 ProgressChangedEventHandler progressChanged)746 {747 using (FileStream archiveStream = new FileStream(ReportBaseName + ".tar",748 FileMode.Create, FileAccess.Write))749 {750 //Add the report into a tar file751 TarArchive archive = TarArchive.CreateOutputTarArchive(archiveStream);752 foreach (FileInfo file in Report.Files)753 {754 TarEntry entry = TarEntry.CreateEntryFromFile(file.FullName);755 entry.Name = Path.GetFileName(entry.Name);756 archive.WriteEntry(entry, false);757 }758 archive.Close();759 }760 761 ProgressManager step = new ProgressManager();762 progress.Steps.Add(new SteppedProgressManagerStep(step, 0.5f, "Compressing"));763 CoderPropID[] propIDs =764 {765 CoderPropID.DictionarySize,766 CoderPropID.PosStateBits,767 CoderPropID.LitContextBits,768 CoderPropID.LitPosBits,769 CoderPropID.Algorithm,770 CoderPropID.NumFastBytes,771 CoderPropID.MatchFinder,772 CoderPropID.EndMarker773 };774 object[] properties =775 {776 (Int32)(1 << 24), //Dictionary Size777 (Int32)2, //PosState Bits778 (Int32)0, //LitContext Bits779 (Int32)2, //LitPos Bits780 (Int32)2, //Algorithm781 (Int32)128, //Fast Bytes782 "bt4", //Match Finger783 true //Write end-of-stream784 };785 786 SevenZip.Compression.LZMA.Encoder encoder = new SevenZip.Compression.LZMA.Encoder();787 encoder.SetCoderProperties(propIDs, properties);788 789 using (FileStream sevenZipFile = new FileStream(ReportBaseName + ".tar.7z",790 FileMode.Create))791 using (FileStream tarStream = new FileStream(ReportBaseName + ".tar",792 FileMode.Open, FileAccess.Read, FileShare.Read, 262144, FileOptions.DeleteOnClose))793 {794 encoder.WriteCoderProperties(sevenZipFile);795 Int64 fileSize = -1;796 for (int i = 0; i < 8; i++)797 sevenZipFile.WriteByte((Byte)(fileSize >> (8 * i)));798 799 step.Total = tarStream.Length;800 ICodeProgress callback = progressChanged == null ? null :801 new SevenZipProgressCallback(this, progress, step, progressChanged);802 encoder.Code(tarStream, sevenZipFile, -1, -1, callback);803 }804 }805 806 /// <summary>807 /// Compresses the report, then uploads it to the server.808 /// </summary>809 /// <param name="progressChanged">The progress changed event handler that should810 /// be called for upload progress updates.</param>811 public void Submit(ProgressChangedEventHandler progressChanged)812 {813 SteppedProgressManager overallProgress = new SteppedProgressManager();814 Compress(overallProgress, progressChanged);815 816 using (FileStream bzipFile = new FileStream(ReportBaseName + ".tar.7z",817 FileMode.Open, FileAccess.Read, FileShare.Read, 131072, FileOptions.DeleteOnClose))818 using (Stream logFile = Report.DebugLog)819 {820 //Build the POST request821 PostDataBuilder builder = new PostDataBuilder();822 builder.AddPart(new PostDataField("action", "upload"));823 builder.AddPart(new PostDataFileField("crashReport", "Report.tar.7z", bzipFile));824 AddStackTraceToRequest(Report.StackTrace, builder);825 826 //Upload the POST request827 WebRequest reportRequest = HttpWebRequest.Create(BlackBoxServer);828 reportRequest.ContentType = builder.ContentType;829 reportRequest.Method = "POST";830 reportRequest.Timeout = int.MaxValue;831 using (Stream formStream = builder.Stream)832 {833 ProgressManager progress = new ProgressManager();834 overallProgress.Steps.Add(new SteppedProgressManagerStep(835 progress, 0.5f, "Uploading"));836 reportRequest.ContentLength = formStream.Length;837 838 using (Stream requestStream = reportRequest.GetRequestStream())839 {840 int lastRead = 0;841 byte[] buffer = new byte[32768];842 while ((lastRead = formStream.Read(buffer, 0, buffer.Length)) != 0)843 {844 requestStream.Write(buffer, 0, lastRead);845 846 progress.Total = formStream.Length;847 progress.Completed = formStream.Position;848 progressChanged(this, new ProgressChangedEventArgs(overallProgress, null));849 }850 }851 }852 853 try854 {855 reportRequest.GetResponse();856 Report.Submitted = true;857 }858 catch (WebException e)859 {860 if (e.Response == null)861 throw;862 863 using (Stream responseStream = e.Response.GetResponseStream())864 {865 try866 {867 XmlReader reader = XmlReader.Create(responseStream);868 reader.ReadToFollowing("error");869 throw new InvalidDataException(string.Format(CultureInfo.CurrentCulture,870 "The server encountered a problem while processing the request: {0}",871 reader.ReadString()));872 }873 catch (XmlException)874 {875 }876 }877 878 throw new InvalidDataException(((HttpWebResponse)e.Response).StatusDescription);879 }880 }881 }882 883 /// <summary>884 /// Adds the stack trace to the given form request.885 /// </summary>886 /// <param name="stackTrace">The stack trace to add.</param>887 /// <param name="builder">The Form request builder to add the stack trace to.</param>888 private static void AddStackTraceToRequest(IList<BlackBoxExceptionEntry> stackTrace,889 PostDataBuilder builder)890 {891 int exceptionIndex = 0;892 foreach (BlackBoxExceptionEntry exceptionStack in stackTrace)893 {894 foreach (string stackFrame in exceptionStack.StackTrace)895 builder.AddPart(new PostDataField(896 string.Format(CultureInfo.InvariantCulture, "stackTrace[{0}][]", exceptionIndex), stackFrame));897 builder.AddPart(new PostDataField(string.Format(CultureInfo.InvariantCulture,898 "stackTrace[{0}][exception]", exceptionIndex), exceptionStack.ExceptionType));899 ++exceptionIndex;900 }901 }902 903 /// <summary>904 /// The path to where the temporary files are stored before uploading.905 /// </summary>906 private static readonly string UploadTempDir =907 Path.Combine(Path.GetTempPath(), "Eraser Crash Reports");908 909 /// <summary>910 /// The URI to the BlackBox server.911 /// </summary>912 private static readonly Uri BlackBoxServer =913 new Uri("http://eraser.heidi.ie/scripts/blackbox/upload.php");914 915 /// <summary>916 /// The report being uploaded.917 /// </summary>918 private BlackBoxReport Report;919 920 /// <summary>921 /// The base name of the report.922 /// </summary>923 private readonly string ReportBaseName;924 }925 360 } -
branches/eraser6/EraserService/Eraser.BlackBox/BlackBoxMainForm.Designer.cs
r2516 r2737 50 50 private void InitializeComponent() 51 51 { 52 this.components = new System.ComponentModel.Container(); 52 53 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(BlackBoxMainForm)); 53 54 this.MainLbl = new System.Windows.Forms.Label(); 54 55 this.SubmitBtn = new System.Windows.Forms.Button(); 55 this. PostponeBtn = new System.Windows.Forms.Button();56 this.CancelBtn = new System.Windows.Forms.Button(); 56 57 this.BlackBoxPic = new System.Windows.Forms.PictureBox(); 57 58 this.ReportsLv = new System.Windows.Forms.ListView(); 58 this.ReportsLvTimestampColumn = new System.Windows.Forms.ColumnHeader(); 59 this.ReportsLvErrorColumn = new System.Windows.Forms.ColumnHeader(); 59 this.ReportsLvTimestampColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); 60 this.ReportsLvErrorColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); 61 this.ReportsLvStatusColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); 62 this.ReportsMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); 63 this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 64 this.DataCollectionPolicyLbl = new System.Windows.Forms.LinkLabel(); 60 65 ((System.ComponentModel.ISupportInitialize)(this.BlackBoxPic)).BeginInit(); 66 this.ReportsMenuStrip.SuspendLayout(); 61 67 this.SuspendLayout(); 62 68 // … … 73 79 this.SubmitBtn.Click += new System.EventHandler(this.SubmitBtn_Click); 74 80 // 75 // PostponeBtn81 // CancelBtn 76 82 // 77 resources.ApplyResources(this.PostponeBtn, "PostponeBtn"); 78 this.PostponeBtn.Name = "PostponeBtn"; 79 this.PostponeBtn.UseVisualStyleBackColor = true; 80 this.PostponeBtn.Click += new System.EventHandler(this.PostponeBtn_Click); 83 resources.ApplyResources(this.CancelBtn, "CancelBtn"); 84 this.CancelBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; 85 this.CancelBtn.Name = "CancelBtn"; 86 this.CancelBtn.UseVisualStyleBackColor = true; 87 this.CancelBtn.Click += new System.EventHandler(this.PostponeBtn_Click); 81 88 // 82 89 // BlackBoxPic … … 93 100 this.ReportsLv.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { 94 101 this.ReportsLvTimestampColumn, 95 this.ReportsLvErrorColumn}); 102 this.ReportsLvErrorColumn, 103 this.ReportsLvStatusColumn}); 104 this.ReportsLv.ContextMenuStrip = this.ReportsMenuStrip; 96 105 this.ReportsLv.FullRowSelect = true; 97 106 this.ReportsLv.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; … … 109 118 resources.ApplyResources(this.ReportsLvErrorColumn, "ReportsLvErrorColumn"); 110 119 // 120 // ReportsLvStatusColumn 121 // 122 resources.ApplyResources(this.ReportsLvStatusColumn, "ReportsLvStatusColumn"); 123 // 124 // ReportsMenuStrip 125 // 126 this.ReportsMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 127 this.deleteToolStripMenuItem}); 128 this.ReportsMenuStrip.Name = "ReportsMenuStrip"; 129 resources.ApplyResources(this.ReportsMenuStrip, "ReportsMenuStrip"); 130 this.ReportsMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(this.ReportsMenuStrip_Opening); 131 // 132 // deleteToolStripMenuItem 133 // 134 this.deleteToolStripMenuItem.Name = "deleteToolStripMenuItem"; 135 resources.ApplyResources(this.deleteToolStripMenuItem, "deleteToolStripMenuItem"); 136 this.deleteToolStripMenuItem.Click += new System.EventHandler(this.deleteToolStripMenuItem_Click); 137 // 138 // DataCollectionPolicyLbl 139 // 140 resources.ApplyResources(this.DataCollectionPolicyLbl, "DataCollectionPolicyLbl"); 141 this.DataCollectionPolicyLbl.Name = "DataCollectionPolicyLbl"; 142 this.DataCollectionPolicyLbl.TabStop = true; 143 this.DataCollectionPolicyLbl.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.DataCollectionPolicyLbl_LinkClicked); 144 // 111 145 // BlackBoxMainForm 112 146 // 147 this.AcceptButton = this.SubmitBtn; 113 148 resources.ApplyResources(this, "$this"); 114 149 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; 150 this.CancelButton = this.CancelBtn; 151 this.Controls.Add(this.DataCollectionPolicyLbl); 115 152 this.Controls.Add(this.ReportsLv); 116 153 this.Controls.Add(this.BlackBoxPic); 117 this.Controls.Add(this. PostponeBtn);154 this.Controls.Add(this.CancelBtn); 118 155 this.Controls.Add(this.SubmitBtn); 119 156 this.Controls.Add(this.MainLbl); … … 123 160 this.Name = "BlackBoxMainForm"; 124 161 this.ShowInTaskbar = false; 125 this. TopMost = true;162 this.Load += new System.EventHandler(this.BlackBoxMainForm_Load); 126 163 ((System.ComponentModel.ISupportInitialize)(this.BlackBoxPic)).EndInit(); 164 this.ReportsMenuStrip.ResumeLayout(false); 127 165 this.ResumeLayout(false); 166 this.PerformLayout(); 128 167 129 168 } … … 133 172 private System.Windows.Forms.Label MainLbl; 134 173 private System.Windows.Forms.Button SubmitBtn; 135 private System.Windows.Forms.Button PostponeBtn;174 private System.Windows.Forms.Button CancelBtn; 136 175 private System.Windows.Forms.PictureBox BlackBoxPic; 137 176 private System.Windows.Forms.ListView ReportsLv; 138 177 private System.Windows.Forms.ColumnHeader ReportsLvTimestampColumn; 139 178 private System.Windows.Forms.ColumnHeader ReportsLvErrorColumn; 179 private System.Windows.Forms.LinkLabel DataCollectionPolicyLbl; 180 private System.Windows.Forms.ContextMenuStrip ReportsMenuStrip; 181 private System.Windows.Forms.ToolStripMenuItem deleteToolStripMenuItem; 182 private System.Windows.Forms.ColumnHeader ReportsLvStatusColumn; 140 183 } 141 184 } -
branches/eraser6/EraserService/Eraser.BlackBox/BlackBoxMainForm.cs
r2516 r2737 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Linq; 25 24 26 using System.ComponentModel; 25 27 using System.Data; … … 35 37 public partial class BlackBoxMainForm : Form 36 38 { 37 public BlackBoxMainForm() 39 #region Singleton instance 40 public static BlackBoxMainForm Get() 41 { 42 if (Instance == null) 43 Instance = new BlackBoxMainForm(); 44 return Instance; 45 } 46 47 private static BlackBoxMainForm Instance; 48 #endregion 49 50 private BlackBoxMainForm() 38 51 { 39 52 InitializeComponent(); 53 } 54 55 private void BlackBoxMainForm_Load(object sender, EventArgs e) 56 { 40 57 Theming.ApplyTheme(this); 41 42 ReportsLv.BeginUpdate(); 43 foreach (BlackBoxReport report in BlackBox.GetDumps()) 44 { 45 if (report.Submitted) 46 continue; 47 48 ListViewItem item = ReportsLv.Items.Add(report.Timestamp.ToString( 49 "F", CultureInfo.CurrentCulture)); 50 if (report.StackTrace.Count != 0) 51 item.SubItems.Add(report.StackTrace[0].ExceptionType); 52 item.Tag = report; 53 item.Checked = true; 54 } 55 ReportsLv.EndUpdate(); 58 RefreshReports(); 56 59 } 57 60 … … 64 67 } 65 68 69 private void ReportsMenuStrip_Opening(object sender, CancelEventArgs e) 70 { 71 if (ReportsLv.SelectedItems.Count == 0) 72 { 73 e.Cancel = true; 74 } 75 } 76 77 private void deleteToolStripMenuItem_Click(object sender, EventArgs e) 78 { 79 List<ListViewItem> selection = new List<ListViewItem>( 80 ReportsLv.SelectedItems.Cast<ListViewItem>()); 81 foreach (ListViewItem item in selection) 82 { 83 try 84 { 85 ((BlackBoxReport)item.Tag).Delete(); 86 item.Remove(); 87 } 88 catch (UnauthorizedAccessException ex) 89 { 90 MessageBox.Show(this, S._("Could not delete report {0} because of " + 91 "the following error: {1}", item.Text, ex.Message), S._("BlackBox"), 92 MessageBoxButtons.OK, MessageBoxIcon.Error); 93 } 94 } 95 } 96 97 private void DataCollectionPolicyLbl_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) 98 { 99 Process.Start("http://eraser.heidi.ie/trac/wiki/DataCollectionPolicy"); 100 } 101 66 102 private void SubmitBtn_Click(object sender, EventArgs e) 67 103 { … … 70 106 if (item.Checked) 71 107 reports.Add((BlackBoxReport)item.Tag); 72 else73 ((BlackBoxReport)item.Tag).Delete();74 108 75 109 if (reports.Count != 0) … … 87 121 } 88 122 123 private void RefreshReports() 124 { 125 ReportsLv.BeginUpdate(); 126 ReportsLv.Items.Clear(); 127 foreach (BlackBoxReport report in BlackBox.GetDumps()) 128 { 129 ListViewItem item = ReportsLv.Items.Add(report.Timestamp.ToString( 130 "g", CultureInfo.CurrentCulture)); 131 if (report.StackTrace.Count != 0) 132 item.SubItems.Add(report.StackTrace[0].ExceptionType); 133 else 134 item.SubItems.Add(string.Empty); 135 item.SubItems.Add(report.Status == BlackBoxReportStatus.New ? 136 S._("Not submitted") : 137 S._("Submitted (Report ID {0})", report.ID)); 138 item.Tag = report; 139 item.Checked = true; 140 } 141 ReportsLv.EndUpdate(); 142 } 143 89 144 /// <summary> 90 145 /// The global BlackBox instance. -
branches/eraser6/EraserService/Eraser.BlackBox/BlackBoxMainForm.resx
r1988 r2737 113 113 </resheader> 114 114 <resheader name="reader"> 115 <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version= 2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>115 <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 116 116 </resheader> 117 117 <resheader name="writer"> 118 <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version= 2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>118 <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 119 119 </resheader> 120 <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version= 2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />120 <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> 121 121 <data name="MainLbl.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms"> 122 122 <value>Top, Left, Right</value> 123 123 </data> 124 <assembly alias="System.Drawing" name="System.Drawing, Version= 2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />124 <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> 125 125 <data name="MainLbl.Location" type="System.Drawing.Point, System.Drawing"> 126 126 <value>82, 9</value> 127 127 </data> 128 128 <data name="MainLbl.Size" type="System.Drawing.Size, System.Drawing"> 129 <value>467, 304</value>130 </data> 131 <assembly alias="mscorlib" name="mscorlib, Version= 2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />129 <value>467, 130</value> 130 </data> 131 <assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> 132 132 <data name="MainLbl.TabIndex" type="System.Int32, mscorlib"> 133 133 <value>0</value> 134 134 </data> 135 135 <data name="MainLbl.Text" xml:space="preserve"> 136 <value>Eraser has encountered problems while running earlier. 136 <value>Eraser has encountered problems while running earlier. The list below shows the reports which have been automatically generated containing information about the error. 137 137 138 The program's state and and a screenshot at the time of the error, as well as the state of your computer, have been stored on your computer as reports and can be sent to the Eraser developers for review. The recorded information was gathered automatically, as a result, the information contained therein may contain potentially sensitive information and you are advised to go through the report before uploading it. Data will be stored on a server which only Eraser developers have access to and personally identifiable data, if any, will be kept confidential and will not be used to identify the reporter. Reports will be completely erased upon the completion of bug fixing. 139 140 Select the reports you wish to submit by checking the name of the report below; the contents of each report can be viewed by double-clicking on the report name below. Editing the contents of the report will result in a modified report being uploaded: deleted files in the report will not be uploaded, and modified files will be uploaded as you have modified them. Do note that by doing so, you are reducing the usefulness of the crash report in fixing the bug. 141 142 Reports not selected for submission will be discarded after the rest have been submitted.</value> 138 Eraser can send the information contained here to Eraser's developers and also check whether the problems have since been fixed. Select the reports you wish to submit by checking the name of the report below; the contents of the report can be viewed by double-clicking on the report.</value> 143 139 </data> 144 140 <data name=">>MainLbl.Name" xml:space="preserve"> … … 146 142 </data> 147 143 <data name=">>MainLbl.Type" xml:space="preserve"> 148 <value>System.Windows.Forms.Label, System.Windows.Forms, Version= 2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>144 <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 149 145 </data> 150 146 <data name=">>MainLbl.Parent" xml:space="preserve"> … … 152 148 </data> 153 149 <data name=">>MainLbl.ZOrder" xml:space="preserve"> 154 <value> 4</value>150 <value>6</value> 155 151 </data> 156 152 <data name="SubmitBtn.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms"> … … 158 154 </data> 159 155 <data name="SubmitBtn.Location" type="System.Drawing.Point, System.Drawing"> 160 <value>3 43, 524</value>156 <value>328, 524</value> 161 157 </data> 162 158 <data name="SubmitBtn.Size" type="System.Drawing.Size, System.Drawing"> 163 <value>1 00, 23</value>159 <value>140, 23</value> 164 160 </data> 165 161 <data name="SubmitBtn.TabIndex" type="System.Int32, mscorlib"> … … 167 163 </data> 168 164 <data name="SubmitBtn.Text" xml:space="preserve"> 169 <value> Submit Now</value>165 <value>Check for Solutions</value> 170 166 </data> 171 167 <data name=">>SubmitBtn.Name" xml:space="preserve"> … … 173 169 </data> 174 170 <data name=">>SubmitBtn.Type" xml:space="preserve"> 175 <value>System.Windows.Forms.Button, System.Windows.Forms, Version= 2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>171 <value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 176 172 </data> 177 173 <data name=">>SubmitBtn.Parent" xml:space="preserve"> … … 179 175 </data> 180 176 <data name=">>SubmitBtn.ZOrder" xml:space="preserve"> 181 <value> 3</value>182 </data> 183 <data name=" PostponeBtn.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">177 <value>5</value> 178 </data> 179 <data name="CancelBtn.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms"> 184 180 <value>Bottom, Right</value> 185 181 </data> 186 <data name=" PostponeBtn.Location" type="System.Drawing.Point, System.Drawing">187 <value>4 49, 524</value>188 </data> 189 <data name=" PostponeBtn.Size" type="System.Drawing.Size, System.Drawing">190 <value> 100, 23</value>191 </data> 192 <data name=" PostponeBtn.TabIndex" type="System.Int32, mscorlib">182 <data name="CancelBtn.Location" type="System.Drawing.Point, System.Drawing"> 183 <value>474, 524</value> 184 </data> 185 <data name="CancelBtn.Size" type="System.Drawing.Size, System.Drawing"> 186 <value>75, 23</value> 187 </data> 188 <data name="CancelBtn.TabIndex" type="System.Int32, mscorlib"> 193 189 <value>4</value> 194 190 </data> 195 <data name=" PostponeBtn.Text" xml:space="preserve">196 <value> Submit Later</value>197 </data> 198 <data name=">> PostponeBtn.Name" xml:space="preserve">199 <value> PostponeBtn</value>200 </data> 201 <data name=">> PostponeBtn.Type" xml:space="preserve">202 <value>System.Windows.Forms.Button, System.Windows.Forms, Version= 2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>203 </data> 204 <data name=">> PostponeBtn.Parent" xml:space="preserve">191 <data name="CancelBtn.Text" xml:space="preserve"> 192 <value>Cancel</value> 193 </data> 194 <data name=">>CancelBtn.Name" xml:space="preserve"> 195 <value>CancelBtn</value> 196 </data> 197 <data name=">>CancelBtn.Type" xml:space="preserve"> 198 <value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 199 </data> 200 <data name=">>CancelBtn.Parent" xml:space="preserve"> 205 201 <value>$this</value> 206 202 </data> 207 <data name=">> PostponeBtn.ZOrder" xml:space="preserve">208 <value> 2</value>203 <data name=">>CancelBtn.ZOrder" xml:space="preserve"> 204 <value>4</value> 209 205 </data> 210 206 <data name="BlackBoxPic.Location" type="System.Drawing.Point, System.Drawing"> … … 221 217 </data> 222 218 <data name=">>BlackBoxPic.Type" xml:space="preserve"> 223 <value>System.Windows.Forms.PictureBox, System.Windows.Forms, Version= 2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>219 <value>System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 224 220 </data> 225 221 <data name=">>BlackBoxPic.Parent" xml:space="preserve"> … … 227 223 </data> 228 224 <data name=">>BlackBoxPic.ZOrder" xml:space="preserve"> 229 <value> 1</value>225 <value>3</value> 230 226 </data> 231 227 <data name="ReportsLv.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms"> … … 236 232 </data> 237 233 <data name="ReportsLvTimestampColumn.Width" type="System.Int32, mscorlib"> 238 <value> 280</value>234 <value>130</value> 239 235 </data> 240 236 <data name="ReportsLvErrorColumn.Text" xml:space="preserve"> … … 242 238 </data> 243 239 <data name="ReportsLvErrorColumn.Width" type="System.Int32, mscorlib"> 244 <value>250</value> 240 <value>240</value> 241 </data> 242 <data name="ReportsLvStatusColumn.Text" xml:space="preserve"> 243 <value>Status</value> 244 </data> 245 <data name="ReportsLvStatusColumn.Width" type="System.Int32, mscorlib"> 246 <value>160</value> 247 </data> 248 <metadata name="ReportsMenuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 249 <value>17, 17</value> 250 </metadata> 251 <data name="ReportsMenuStrip.Size" type="System.Drawing.Size, System.Drawing"> 252 <value>108, 26</value> 253 </data> 254 <data name=">>ReportsMenuStrip.Name" xml:space="preserve"> 255 <value>ReportsMenuStrip</value> 256 </data> 257 <data name=">>ReportsMenuStrip.Type" xml:space="preserve"> 258 <value>System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 245 259 </data> 246 260 <data name="ReportsLv.Location" type="System.Drawing.Point, System.Drawing"> 247 <value>12, 316</value>261 <value>12, 142</value> 248 262 </data> 249 263 <data name="ReportsLv.Size" type="System.Drawing.Size, System.Drawing"> 250 <value>537, 202</value>264 <value>537, 376</value> 251 265 </data> 252 266 <data name="ReportsLv.TabIndex" type="System.Int32, mscorlib"> … … 257 271 </data> 258 272 <data name=">>ReportsLv.Type" xml:space="preserve"> 259 <value>System.Windows.Forms.ListView, System.Windows.Forms, Version= 2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>273 <value>System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 260 274 </data> 261 275 <data name=">>ReportsLv.Parent" xml:space="preserve"> … … 263 277 </data> 264 278 <data name=">>ReportsLv.ZOrder" xml:space="preserve"> 265 <value>0</value> 266 </data> 267 <metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> 279 <value>2</value> 280 </data> 281 <data name="deleteToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing"> 282 <value>152, 22</value> 283 </data> 284 <data name="deleteToolStripMenuItem.Text" xml:space="preserve"> 285 <value>Delete</value> 286 </data> 287 <data name="DataCollectionPolicyLbl.AutoSize" type="System.Boolean, mscorlib"> 288 <value>True</value> 289 </data> 290 <data name="DataCollectionPolicyLbl.Location" type="System.Drawing.Point, System.Drawing"> 291 <value>12, 528</value> 292 </data> 293 <data name="DataCollectionPolicyLbl.Size" type="System.Drawing.Size, System.Drawing"> 294 <value>123, 15</value> 295 </data> 296 <data name="DataCollectionPolicyLbl.TabIndex" type="System.Int32, mscorlib"> 297 <value>5</value> 298 </data> 299 <data name="DataCollectionPolicyLbl.Text" xml:space="preserve"> 300 <value>Data Collection Policy</value> 301 </data> 302 <data name=">>DataCollectionPolicyLbl.Name" xml:space="preserve"> 303 <value>DataCollectionPolicyLbl</value> 304 </data> 305 <data name=">>DataCollectionPolicyLbl.Type" xml:space="preserve"> 306 <value>System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 307 </data> 308 <data name=">>DataCollectionPolicyLbl.Parent" xml:space="preserve"> 309 <value>$this</value> 310 </data> 311 <data name=">>DataCollectionPolicyLbl.ZOrder" xml:space="preserve"> 312 <value>1</value> 313 </data> 314 <metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> 268 315 <value>True</value> 269 316 </metadata> … … 1844 1891 </data> 1845 1892 <data name=">>ReportsLvTimestampColumn.Type" xml:space="preserve"> 1846 <value>System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version= 2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>1893 <value>System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 1847 1894 </data> 1848 1895 <data name=">>ReportsLvErrorColumn.Name" xml:space="preserve"> … … 1850 1897 </data> 1851 1898 <data name=">>ReportsLvErrorColumn.Type" xml:space="preserve"> 1852 <value>System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 1899 <value>System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 1900 </data> 1901 <data name=">>ReportsLvStatusColumn.Name" xml:space="preserve"> 1902 <value>ReportsLvStatusColumn</value> 1903 </data> 1904 <data name=">>ReportsLvStatusColumn.Type" xml:space="preserve"> 1905 <value>System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 1906 </data> 1907 <data name=">>deleteToolStripMenuItem.Name" xml:space="preserve"> 1908 <value>deleteToolStripMenuItem</value> 1909 </data> 1910 <data name=">>deleteToolStripMenuItem.Type" xml:space="preserve"> 1911 <value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 1853 1912 </data> 1854 1913 <data name=">>$this.Name" xml:space="preserve"> … … 1856 1915 </data> 1857 1916 <data name=">>$this.Type" xml:space="preserve"> 1858 <value>System.Windows.Forms.Form, System.Windows.Forms, Version= 2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>1917 <value>System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 1859 1918 </data> 1860 1919 </root> -
branches/eraser6/EraserService/Eraser.BlackBox/BlackBoxUploadForm.Designer.cs
r2516 r2737 50 50 private void InitializeComponent() 51 51 { 52 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(BlackBoxUploadForm)); 53 this.ButtonsBevel = new Trustbridge.Windows.Controls.BevelLine(); 54 this.ButtonsPnl = new System.Windows.Forms.Panel(); 55 this.CancelBtn = new System.Windows.Forms.Button(); 56 this.TitleLbl = new System.Windows.Forms.Label(); 57 this.ProgressPb = new System.Windows.Forms.ProgressBar(); 58 this.UploadWorker = new System.ComponentModel.BackgroundWorker(); 59 this.ProgressLbl = new System.Windows.Forms.Label(); 60 this.ButtonsPnl.SuspendLayout(); 61 this.SuspendLayout(); 62 // 63 // ButtonsBevel 64 // 65 this.ButtonsBevel.AccessibleDescription = null; 66 this.ButtonsBevel.AccessibleName = null; 67 resources.ApplyResources(this.ButtonsBevel, "ButtonsBevel"); 68 this.ButtonsBevel.Angle = 90; 69 this.ButtonsBevel.BackgroundImage = null; 70 this.ButtonsBevel.Font = null; 71 this.ButtonsBevel.Name = "ButtonsBevel"; 72 // 73 // ButtonsPnl 74 // 75 this.ButtonsPnl.AccessibleDescription = null; 76 this.ButtonsPnl.AccessibleName = null; 77 resources.ApplyResources(this.ButtonsPnl, "ButtonsPnl"); 78 this.ButtonsPnl.BackColor = System.Drawing.SystemColors.Control; 79 this.ButtonsPnl.BackgroundImage = null; 80 this.ButtonsPnl.Controls.Add(this.ButtonsBevel); 81 this.ButtonsPnl.Controls.Add(this.CancelBtn); 82 this.ButtonsPnl.Font = null; 83 this.ButtonsPnl.Name = "ButtonsPnl"; 84 // 85 // CancelBtn 86 // 87 this.CancelBtn.AccessibleDescription = null; 88 this.CancelBtn.AccessibleName = null; 89 resources.ApplyResources(this.CancelBtn, "CancelBtn"); 90 this.CancelBtn.BackgroundImage = null; 91 this.CancelBtn.Font = null; 92 this.CancelBtn.Name = "CancelBtn"; 93 this.CancelBtn.UseVisualStyleBackColor = true; 94 this.CancelBtn.Click += new System.EventHandler(this.CancelBtn_Click); 95 // 96 // TitleLbl 97 // 98 this.TitleLbl.AccessibleDescription = null; 99 this.TitleLbl.AccessibleName = null; 100 resources.ApplyResources(this.TitleLbl, "TitleLbl"); 101 this.TitleLbl.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(51)))), ((int)(((byte)(153))))); 102 this.TitleLbl.Name = "TitleLbl"; 103 // 104 // ProgressPb 105 // 106 this.ProgressPb.AccessibleDescription = null; 107 this.ProgressPb.AccessibleName = null; 108 resources.ApplyResources(this.ProgressPb, "ProgressPb"); 109 this.ProgressPb.BackgroundImage = null; 110 this.ProgressPb.Font = null; 111 this.ProgressPb.Name = "ProgressPb"; 112 // 113 // UploadWorker 114 // 115 this.UploadWorker.WorkerReportsProgress = true; 116 this.UploadWorker.WorkerSupportsCancellation = true; 117 this.UploadWorker.DoWork += new System.ComponentModel.DoWorkEventHandler(this.UploadWorker_DoWork); 118 this.UploadWorker.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.UploadWorker_RunWorkerCompleted); 119 this.UploadWorker.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.UploadWorker_ProgressChanged); 120 // 121 // ProgressLbl 122 // 123 this.ProgressLbl.AccessibleDescription = null; 124 this.ProgressLbl.AccessibleName = null; 125 resources.ApplyResources(this.ProgressLbl, "ProgressLbl"); 126 this.ProgressLbl.Font = null; 127 this.ProgressLbl.Name = "ProgressLbl"; 128 // 129 // BlackBoxUploadForm 130 // 131 this.AccessibleDescription = null; 132 this.AccessibleName = null; 133 resources.ApplyResources(this, "$this"); 134 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; 135 this.BackColor = System.Drawing.SystemColors.Window; 136 this.BackgroundImage = null; 137 this.Controls.Add(this.ProgressLbl); 138 this.Controls.Add(this.ProgressPb); 139 this.Controls.Add(this.TitleLbl); 140 this.Controls.Add(this.ButtonsPnl); 141 this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; 142 this.MaximizeBox = false; 143 this.Name = "BlackBoxUploadForm"; 144 this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.BlackBoxUploadForm_FormClosing); 145 this.ButtonsPnl.ResumeLayout(false); 146 this.ResumeLayout(false); 147 this.PerformLayout(); 52 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(BlackBoxUploadForm)); 53 this.ButtonsBevel = new Trustbridge.Windows.Controls.BevelLine(); 54 this.ButtonsPnl = new System.Windows.Forms.Panel(); 55 this.CancelBtn = new System.Windows.Forms.Button(); 56 this.TitleLbl = new System.Windows.Forms.Label(); 57 this.ProgressPb = new System.Windows.Forms.ProgressBar(); 58 this.UploadWorker = new System.ComponentModel.BackgroundWorker(); 59 this.ProgressLbl = new System.Windows.Forms.Label(); 60 this.ButtonsPnl.SuspendLayout(); 61 this.SuspendLayout(); 62 // 63 // ButtonsBevel 64 // 65 resources.ApplyResources(this.ButtonsBevel, "ButtonsBevel"); 66 this.ButtonsBevel.Angle = 90; 67 this.ButtonsBevel.Name = "ButtonsBevel"; 68 // 69 // ButtonsPnl 70 // 71 resources.ApplyResources(this.ButtonsPnl, "ButtonsPnl"); 72 this.ButtonsPnl.BackColor = System.Drawing.SystemColors.Control; 73 this.ButtonsPnl.Controls.Add(this.ButtonsBevel); 74 this.ButtonsPnl.Controls.Add(this.CancelBtn); 75 this.ButtonsPnl.Name = "ButtonsPnl"; 76 // 77 // CancelBtn 78 // 79 resources.ApplyResources(this.CancelBtn, "CancelBtn"); 80 this.CancelBtn.Name = "CancelBtn"; 81 this.CancelBtn.UseVisualStyleBackColor = true; 82 this.CancelBtn.Click += new System.EventHandler(this.CancelBtn_Click); 83 // 84 // TitleLbl 85 // 86 resources.ApplyResources(this.TitleLbl, "TitleLbl"); 87 this.TitleLbl.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(51)))), ((int)(((byte)(153))))); 88 this.TitleLbl.Name = "TitleLbl"; 89 // 90 // ProgressPb 91 // 92 resources.ApplyResources(this.ProgressPb, "ProgressPb"); 93 this.ProgressPb.Name = "ProgressPb"; 94 // 95 // UploadWorker 96 // 97 this.UploadWorker.WorkerReportsProgress = true; 98 this.UploadWorker.WorkerSupportsCancellation = true; 99 this.UploadWorker.DoWork += new System.ComponentModel.DoWorkEventHandler(this.UploadWorker_DoWork); 100 this.UploadWorker.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.UploadWorker_ProgressChanged); 101 this.UploadWorker.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.UploadWorker_RunWorkerCompleted); 102 // 103 // ProgressLbl 104 // 105 resources.ApplyResources(this.ProgressLbl, "ProgressLbl"); 106 this.ProgressLbl.Name = "ProgressLbl"; 107 // 108 // BlackBoxUploadForm 109 // 110 resources.ApplyResources(this, "$this"); 111 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; 112 this.BackColor = System.Drawing.SystemColors.Window; 113 this.Controls.Add(this.ProgressLbl); 114 this.Controls.Add(this.ProgressPb); 115 this.Controls.Add(this.TitleLbl); 116 this.Controls.Add(this.ButtonsPnl); 117 this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; 118 this.MaximizeBox = false; 119 this.Name = "BlackBoxUploadForm"; 120 this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.BlackBoxUploadForm_FormClosing); 121 this.ButtonsPnl.ResumeLayout(false); 122 this.ResumeLayout(false); 123 this.PerformLayout(); 148 124 149 125 } -
branches/eraser6/EraserService/Eraser.BlackBox/BlackBoxUploadForm.cs
r2516 r2737 71 71 1.0f / reports.Count)); 72 72 73 BlackBoxReportUploader uploader = new BlackBoxReportUploader(reports[i]); 74 75 //Check that a similar report has not yet been uploaded. 76 UploadWorker.ReportProgress((int)(overallProgress.Progress * 100), 77 S._("Checking for status of report {0}...", reports[i].Name)); 78 if (!uploader.IsNew) 79 continue; 80 73 //Allow us to bail out. 81 74 if (UploadWorker.CancellationPending) 82 75 throw new OperationCanceledException(); 83 76 84 // Upload the report.85 UploadWorker.ReportProgress((int)(overallProgress.Progress * 100),86 S._("Compressing Report {0}: {1:#0.00%}", reports[i].Name, 0));77 //If we have not submitted the report before upload it. 78 if (reports[i].Status == BlackBoxReportStatus.New) 79 Upload(reports[i], overallProgress, reportProgress); 87 80 88 uploader.Submit(delegate(object from, EraserProgressChangedEventArgs e2)89 {90 reportProgress.Completed = (int)(e2.Progress.Progress * reportProgress.Total);91 SteppedProgressManager reportSteps = (SteppedProgressManager)e2.Progress;92 int step = reportSteps.Steps.IndexOf(reportSteps.CurrentStep);81 //Otherwise check for solutions. 82 else 83 CheckStatus(reports[i], overallProgress, reportProgress); 84 } 85 } 93 86 94 UploadWorker.ReportProgress((int)overallProgress.Progress,95 step == 0 ?96 S._("Compressing Report {0}: {1:#0.00%}",97 reports[i].Name, reportSteps.Progress) :98 S._("Uploading Report {0}: {1:#0.00%}",99 reports[i].Name, reportSteps.Progress));87 private void Upload(BlackBoxReport report, SteppedProgressManager overallProgress, 88 ProgressManager reportProgress) 89 { 90 //Upload the report. 91 UploadWorker.ReportProgress((int)(overallProgress.Progress * 100), 92 S._("Compressing Report {0}: {1:#0.00%}", report.Name, 0)); 100 93 101 if (UploadWorker.CancellationPending) 102 throw new OperationCanceledException(); 103 }); 104 } 94 BlackBoxReportUploader uploader = new BlackBoxReportUploader(report); 95 uploader.Submit(delegate(object from, EraserProgressChangedEventArgs e2) 96 { 97 reportProgress.Completed = (int)(e2.Progress.Progress * reportProgress.Total); 98 SteppedProgressManager reportSteps = (SteppedProgressManager)e2.Progress; 99 int step = reportSteps.Steps.IndexOf(reportSteps.CurrentStep); 100 101 UploadWorker.ReportProgress((int)overallProgress.Progress, 102 step == 0 ? 103 S._("Compressing Report {0}: {1:#0.00%}", 104 report.Name, reportSteps.Progress) : 105 S._("Uploading Report {0}: {1:#0.00%}", 106 report.Name, reportSteps.Progress)); 107 108 if (UploadWorker.CancellationPending) 109 throw new OperationCanceledException(); 110 }); 111 } 112 113 private void CheckStatus(BlackBoxReport report, SteppedProgressManager overallProgress, 114 ProgressManager reportProgress) 115 { 116 //Upload the report. 117 UploadWorker.ReportProgress((int)(overallProgress.Progress * 100), 118 S._("Checking for solution for {0}...", report.Name)); 119 120 BlackBoxReportUploader uploader = new BlackBoxReportUploader(report); 121 report.Status = uploader.Status; 105 122 } 106 123 -
branches/eraser6/EraserService/Eraser.BlackBox/BlackBoxUploadForm.it.resx
r1973 r2737 113 113 </resheader> 114 114 <resheader name="reader"> 115 <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version= 2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>115 <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 116 116 </resheader> 117 117 <resheader name="writer"> 118 <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version= 2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>118 <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 119 119 </resheader> 120 120 <data name="CancelBtn.Text" xml:space="preserve"> 121 121 <value>Annulla</value> 122 122 </data> 123 <assembly alias="System.Drawing" name="System.Drawing, Version= 2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />123 <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> 124 124 <data name="TitleLbl.Size" type="System.Drawing.Size, System.Drawing"> 125 125 <value>201, 20</value> -
branches/eraser6/EraserService/Eraser.BlackBox/BlackBoxUploadForm.resx
r1973 r2737 113 113 </resheader> 114 114 <resheader name="reader"> 115 <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version= 2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>115 <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 116 116 </resheader> 117 117 <resheader name="writer"> 118 <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version= 2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>118 <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 119 119 </resheader> 120 <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> 121 <data name="ButtonsBevel.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms"> 122 <value>Top, Left, Right</value> 123 </data> 124 <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> 125 <data name="ButtonsBevel.Location" type="System.Drawing.Point, System.Drawing"> 126 <value>0, 0</value> 127 </data> 128 <data name="ButtonsBevel.Size" type="System.Drawing.Size, System.Drawing"> 129 <value>345, 2</value> 130 </data> 131 <assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> 132 <data name="ButtonsBevel.TabIndex" type="System.Int32, mscorlib"> 133 <value>0</value> 134 </data> 135 <data name=">>ButtonsBevel.Name" xml:space="preserve"> 136 <value>ButtonsBevel</value> 137 </data> 138 <data name=">>ButtonsBevel.Type" xml:space="preserve"> 139 <value>Trustbridge.Windows.Controls.BevelLine, BevelLine, Version=1.0.4456.34141, Culture=neutral, PublicKeyToken=3ac89a0351e689b6</value> 140 </data> 141 <data name=">>ButtonsBevel.Parent" xml:space="preserve"> 142 <value>ButtonsPnl</value> 143 </data> 144 <data name=">>ButtonsBevel.ZOrder" xml:space="preserve"> 145 <value>0</value> 146 </data> 147 <data name="ButtonsPnl.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms"> 148 <value>Bottom, Left, Right</value> 149 </data> 150 <data name="CancelBtn.Location" type="System.Drawing.Point, System.Drawing"> 151 <value>260, 8</value> 152 </data> 153 <data name="CancelBtn.Size" type="System.Drawing.Size, System.Drawing"> 154 <value>75, 23</value> 155 </data> 156 <data name="CancelBtn.TabIndex" type="System.Int32, mscorlib"> 157 <value>2</value> 158 </data> 159 <data name="CancelBtn.Text" xml:space="preserve"> 160 <value>Cancel</value> 161 </data> 162 <data name=">>CancelBtn.Name" xml:space="preserve"> 163 <value>CancelBtn</value> 164 </data> 165 <data name=">>CancelBtn.Type" xml:space="preserve"> 166 <value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 167 </data> 168 <data name=">>CancelBtn.Parent" xml:space="preserve"> 169 <value>ButtonsPnl</value> 170 </data> 171 <data name=">>CancelBtn.ZOrder" xml:space="preserve"> 172 <value>1</value> 173 </data> 174 <data name="ButtonsPnl.Location" type="System.Drawing.Point, System.Drawing"> 175 <value>0, 96</value> 176 </data> 177 <data name="ButtonsPnl.Size" type="System.Drawing.Size, System.Drawing"> 178 <value>345, 38</value> 179 </data> 180 <data name="ButtonsPnl.TabIndex" type="System.Int32, mscorlib"> 181 <value>1</value> 182 </data> 183 <data name=">>ButtonsPnl.Name" xml:space="preserve"> 184 <value>ButtonsPnl</value> 185 </data> 186 <data name=">>ButtonsPnl.Type" xml:space="preserve"> 187 <value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 188 </data> 189 <data name=">>ButtonsPnl.Parent" xml:space="preserve"> 190 <value>$this</value> 191 </data> 192 <data name=">>ButtonsPnl.ZOrder" xml:space="preserve"> 193 <value>3</value> 194 </data> 195 <data name="TitleLbl.AutoSize" type="System.Boolean, mscorlib"> 196 <value>True</value> 197 </data> 198 <data name="TitleLbl.Font" type="System.Drawing.Font, System.Drawing"> 199 <value>Microsoft Sans Serif, 12pt</value> 200 </data> 201 <data name="TitleLbl.Location" type="System.Drawing.Point, System.Drawing"> 202 <value>9, 9</value> 203 </data> 204 <data name="TitleLbl.Size" type="System.Drawing.Size, System.Drawing"> 205 <value>168, 20</value> 206 </data> 207 <data name="TitleLbl.TabIndex" type="System.Int32, mscorlib"> 208 <value>2</value> 209 </data> 210 <data name="TitleLbl.Text" xml:space="preserve"> 211 <value>Checking for Solutions</value> 212 </data> 213 <data name=">>TitleLbl.Name" xml:space="preserve"> 214 <value>TitleLbl</value> 215 </data> 216 <data name=">>TitleLbl.Type" xml:space="preserve"> 217 <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 218 </data> 120 219 <data name=">>TitleLbl.Parent" xml:space="preserve"> 121 220 <value>$this</value> 122 221 </data> 123 <data name=">>$this.Type" xml:space="preserve"> 124 <value>System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 125 </data> 126 <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> 127 <data name="CancelBtn.Location" type="System.Drawing.Point, System.Drawing"> 128 <value>260, 8</value> 222 <data name=">>TitleLbl.ZOrder" xml:space="preserve"> 223 <value>2</value> 224 </data> 225 <data name="ProgressPb.Location" type="System.Drawing.Point, System.Drawing"> 226 <value>13, 70</value> 227 </data> 228 <data name="ProgressPb.Size" type="System.Drawing.Size, System.Drawing"> 229 <value>321, 17</value> 230 </data> 231 <data name="ProgressPb.TabIndex" type="System.Int32, mscorlib"> 232 <value>3</value> 233 </data> 234 <data name=">>ProgressPb.Name" xml:space="preserve"> 235 <value>ProgressPb</value> 236 </data> 237 <data name=">>ProgressPb.Type" xml:space="preserve"> 238 <value>System.Windows.Forms.ProgressBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 239 </data> 240 <data name=">>ProgressPb.Parent" xml:space="preserve"> 241 <value>$this</value> 242 </data> 243 <data name=">>ProgressPb.ZOrder" xml:space="preserve"> 244 <value>1</value> 245 </data> 246 <metadata name="UploadWorker.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 247 <value>17, 17</value> 248 </metadata> 249 <data name="ProgressLbl.AutoSize" type="System.Boolean, mscorlib"> 250 <value>True</value> 251 </data> 252 <data name="ProgressLbl.Location" type="System.Drawing.Point, System.Drawing"> 253 <value>11, 52</value> 254 </data> 255 <data name="ProgressLbl.Size" type="System.Drawing.Size, System.Drawing"> 256 <value>130, 15</value> 257 </data> 258 <data name="ProgressLbl.TabIndex" type="System.Int32, mscorlib"> 259 <value>4</value> 260 </data> 261 <data name="ProgressLbl.Text" xml:space="preserve"> 262 <value>Compressing reports...</value> 263 </data> 264 <data name=">>ProgressLbl.Name" xml:space="preserve"> 265 <value>ProgressLbl</value> 266 </data> 267 <data name=">>ProgressLbl.Type" xml:space="preserve"> 268 <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 269 </data> 270 <data name=">>ProgressLbl.Parent" xml:space="preserve"> 271 <value>$this</value> 129 272 </data> 130 273 <data name=">>ProgressLbl.ZOrder" xml:space="preserve"> 131 274 <value>0</value> 132 275 </data> 133 <data name="ProgressPb.Size" type="System.Drawing.Size, System.Drawing"> 134 <value>321, 17</value> 135 </data> 136 <data name=">>ProgressPb.Type" xml:space="preserve"> 137 <value>System.Windows.Forms.ProgressBar, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 138 </data> 139 <data name="ProgressLbl.Location" type="System.Drawing.Point, System.Drawing"> 140 <value>11, 52</value> 141 </data> 142 <data name=">>UploadWorker.Type" xml:space="preserve"> 143 <value>System.ComponentModel.BackgroundWorker, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 144 </data> 145 <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> 146 <data name="ButtonsBevel.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms"> 147 <value>Top, Left, Right</value> 148 </data> 149 <data name="ProgressPb.Location" type="System.Drawing.Point, System.Drawing"> 150 <value>13, 70</value> 151 </data> 152 <assembly alias="mscorlib" name="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> 153 <data name="ButtonsBevel.TabIndex" type="System.Int32, mscorlib"> 154 <value>0</value> 155 </data> 156 <data name=">>ButtonsPnl.ZOrder" xml:space="preserve"> 157 <value>3</value> 158 </data> 159 <data name="CancelBtn.Size" type="System.Drawing.Size, System.Drawing"> 160 <value>75, 23</value> 161 </data> 162 <data name=">>UploadWorker.Name" xml:space="preserve"> 163 <value>UploadWorker</value> 164 </data> 165 <data name="ProgressLbl.Text" xml:space="preserve"> 166 <value>Compressing reports...</value> 167 </data> 168 <data name=">>CancelBtn.Type" xml:space="preserve"> 169 <value>System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 170 </data> 171 <data name="ButtonsPnl.TabIndex" type="System.Int32, mscorlib"> 172 <value>1</value> 173 </data> 174 <data name="ProgressLbl.AutoSize" type="System.Boolean, mscorlib"> 276 <metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> 175 277 <value>True</value> 176 </data> 177 <data name=">>ButtonsBevel.Name" xml:space="preserve"> 178 <value>ButtonsBevel</value> 179 </data> 180 <data name="ProgressLbl.TabIndex" type="System.Int32, mscorlib"> 181 <value>4</value> 182 </data> 183 <data name=">>TitleLbl.Name" xml:space="preserve"> 184 <value>TitleLbl</value> 185 </data> 186 <data name=">>ProgressLbl.Type" xml:space="preserve"> 187 <value>System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 188 </data> 189 <data name=">>ButtonsPnl.Name" xml:space="preserve"> 190 <value>ButtonsPnl</value> 191 </data> 192 <data name="TitleLbl.Text" xml:space="preserve"> 193 <value>Uploading Crash Report</value> 194 </data> 195 <data name="CancelBtn.TabIndex" type="System.Int32, mscorlib"> 196 <value>2</value> 197 </data> 198 <data name=">>ProgressLbl.Parent" xml:space="preserve"> 199 <value>$this</value> 200 </data> 201 <data name=">>ButtonsPnl.Type" xml:space="preserve"> 202 <value>System.Windows.Forms.Panel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 203 </data> 204 <data name="CancelBtn.Text" xml:space="preserve"> 205 <value>Cancel</value> 206 </data> 207 <data name=">>ButtonsBevel.Parent" xml:space="preserve"> 208 <value>ButtonsPnl</value> 209 </data> 210 <data name="TitleLbl.Location" type="System.Drawing.Point, System.Drawing"> 211 <value>9, 9</value> 212 </data> 213 <data name=">>CancelBtn.Name" xml:space="preserve"> 214 <value>CancelBtn</value> 215 </data> 216 <data name=">>TitleLbl.Type" xml:space="preserve"> 217 <value>System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 218 </data> 219 <data name=">>ButtonsBevel.ZOrder" xml:space="preserve"> 220 <value>0</value> 278 </metadata> 279 <data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing"> 280 <value>96, 96</value> 221 281 </data> 222 282 <data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing"> 223 283 <value>344, 132</value> 224 284 </data> 225 <data name=">>ButtonsBevel.Type" xml:space="preserve">226 <value>Trustbridge.Windows.Controls.BevelLine, BevelLine, Version=1.0.3589.29437, Culture=neutral, PublicKeyToken=77979e16578a2d88</value>227 </data>228 <data name="ProgressLbl.Size" type="System.Drawing.Size, System.Drawing">229 <value>130, 15</value>230 </data>231 <data name=">>ProgressPb.Parent" xml:space="preserve">232 <value>$this</value>233 </data>234 <data name=">>ProgressPb.Name" xml:space="preserve">235 <value>ProgressPb</value>236 </data>237 <data name="TitleLbl.TabIndex" type="System.Int32, mscorlib">238 <value>2</value>239 </data>240 <data name="ButtonsPnl.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">241 <value>Bottom, Left, Right</value>242 </data>243 <data name="ButtonsPnl.Size" type="System.Drawing.Size, System.Drawing">244 <value>345, 38</value>245 </data>246 <data name=">>ProgressPb.ZOrder" xml:space="preserve">247 <value>1</value>248 </data>249 <data name=">>ProgressLbl.Name" xml:space="preserve">250 <value>ProgressLbl</value>251 </data>252 <data name="$this.Text" xml:space="preserve">253 <value>Eraser Crash Assistant</value>254 </data>255 <data name=">>CancelBtn.Parent" xml:space="preserve">256 <value>ButtonsPnl</value>257 </data>258 <data name="ButtonsBevel.Location" type="System.Drawing.Point, System.Drawing">259 <value>0, 0</value>260 </data>261 <data name="TitleLbl.AutoSize" type="System.Boolean, mscorlib">262 <value>True</value>263 </data>264 <data name="TitleLbl.Size" type="System.Drawing.Size, System.Drawing">265 <value>180, 20</value>266 </data>267 <data name="ButtonsPnl.Location" type="System.Drawing.Point, System.Drawing">268 <value>0, 96</value>269 </data>270 285 <data name="$this.Font" type="System.Drawing.Font, System.Drawing"> 271 286 <value>Microsoft Sans Serif, 9pt</value> 272 </data>273 <data name=">>ButtonsPnl.Parent" xml:space="preserve">274 <value>$this</value>275 </data>276 <data name=">>TitleLbl.ZOrder" xml:space="preserve">277 <value>2</value>278 </data>279 <data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">280 <value>96, 96</value>281 </data>282 <data name="ProgressPb.TabIndex" type="System.Int32, mscorlib">283 <value>3</value>284 287 </data> 285 288 <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> … … 1843 1846 </value> 1844 1847 </data> 1848 <data name="$this.Text" xml:space="preserve"> 1849 <value>Eraser Crash Assistant</value> 1850 </data> 1851 <data name=">>UploadWorker.Name" xml:space="preserve"> 1852 <value>UploadWorker</value> 1853 </data> 1854 <data name=">>UploadWorker.Type" xml:space="preserve"> 1855 <value>System.ComponentModel.BackgroundWorker, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 1856 </data> 1845 1857 <data name=">>$this.Name" xml:space="preserve"> 1846 1858 <value>BlackBoxUploadForm</value> 1847 1859 </data> 1848 <data name=">>CancelBtn.ZOrder" xml:space="preserve"> 1849 <value>1</value> 1850 </data> 1851 <data name="ButtonsBevel.Size" type="System.Drawing.Size, System.Drawing"> 1852 <value>345, 2</value> 1853 </data> 1854 <data name="TitleLbl.Font" type="System.Drawing.Font, System.Drawing"> 1855 <value>Microsoft Sans Serif, 12pt</value> 1856 </data> 1857 <metadata name="UploadWorker.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 1858 <value>17, 17</value> 1859 </metadata> 1860 <metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> 1861 <value>True</value> 1862 </metadata> 1863 <metadata name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> 1864 <value>Italian</value> 1865 </metadata> 1860 <data name=">>$this.Type" xml:space="preserve"> 1861 <value>System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 1862 </data> 1866 1863 </root> -
branches/eraser6/EraserService/Eraser.BlackBox/Eraser.BlackBox.csproj
r2621 r2737 84 84 </Compile> 85 85 <Compile Include="BlackBox.cs" /> 86 <Compile Include="BlackBoxClientTool.cs" /> 86 87 <Compile Include="BlackBoxMainForm.cs"> 87 88 <SubType>Form</SubType> … … 90 91 <DependentUpon>BlackBoxMainForm.cs</DependentUpon> 91 92 </Compile> 93 <Compile Include="BlackBoxNotifier.cs" /> 94 <Compile Include="BlackBoxReport.cs" /> 92 95 <Compile Include="BlackBoxUploadForm.cs"> 93 96 <SubType>Form</SubType> … … 96 99 <DependentUpon>BlackBoxUploadForm.cs</DependentUpon> 97 100 </Compile> 101 <Compile Include="BlackBoxReportUploader.cs" /> 98 102 <Compile Include="Plugin.cs" /> 99 103 <Compile Include="Properties\Resources.Designer.cs"> -
branches/eraser6/EraserService/Eraser.BlackBox/Plugin.cs
r2516 r2737 36 36 BlackBox blackBox = BlackBox.Get(); 37 37 38 //Hook the Application's idle loop to display the form 39 Application.Idle += OnGUIIdle; 38 //Register our client tools 39 Host.Instance.ClientTools.Add(new BlackBoxClientTool()); 40 41 bool allSubmitted = true; 42 foreach (BlackBoxReport report in blackBox.GetDumps()) 43 if (report.Status == BlackBoxReportStatus.New) 44 { 45 allSubmitted = false; 46 break; 47 } 48 49 if (!allSubmitted) 50 { 51 Host.Instance.Notifiers.Add(new BlackBoxNotifier()); 52 } 40 53 } 41 54 … … 68 81 { 69 82 Application.Idle -= OnGUIIdle; 70 BlackBox blackBox = BlackBox.Get(); 71 72 bool allSubmitted = true; 73 foreach (BlackBoxReport report in blackBox.GetDumps()) 74 if (!report.Submitted) 75 { 76 allSubmitted = false; 77 break; 78 } 79 80 if (allSubmitted) 81 return; 82 83 BlackBoxMainForm form = new BlackBoxMainForm(); 84 form.Show(); 83 85 84 } 86 85 } -
branches/eraser6/EraserService/Eraser.BlackBox/Strings.en.resx
r1973 r2737 118 118 <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 119 119 </resheader> 120 <data name="Checking for status of report {0}..." xml:space="preserve"> 121 <value>Checking for status of report {0}...</value> 120 <data name="Manage BlackBox Reports" xml:space="preserve"> 121 <value>Manage BlackBox Reports</value> 122 </data> 123 <data name="Could not delete report {0} because of the following error: {1}" xml:space="preserve"> 124 <value>Could not delete report {0} because of the following error: {1}</value> 125 </data> 126 <data name="BlackBox" xml:space="preserve"> 127 <value>BlackBox</value> 128 </data> 129 <data name="Not submitted" xml:space="preserve"> 130 <value>Not submitted</value> 131 </data> 132 <data name="Submitted (Report ID {0})" xml:space="preserve"> 133 <value>Submitted (Report ID {0})</value> 134 </data> 135 <data name="Eraser BlackBox: Crash Reports Collected" xml:space="preserve"> 136 <value>Eraser BlackBox: Crash Reports Collected</value> 137 </data> 138 <data name="There are crash reports which have yet to be submitted. Click on this balloon to see the list of reports." xml:space="preserve"> 139 <value>There are crash reports which have yet to be submitted. Click on this balloon to see the list of reports.</value> 122 140 </data> 123 141 <data name="Compressing Report {0}: {1:#0.00%}" xml:space="preserve"> … … 126 144 <data name="Uploading Report {0}: {1:#0.00%}" xml:space="preserve"> 127 145 <value>Uploading Report {0}: {1:#0.00%}</value> 146 </data> 147 <data name="Checking for solution for {0}..." xml:space="preserve"> 148 <value>Checking for solution for {0}...</value> 128 149 </data> 129 150 <data name="Reports submitted successfully." xml:space="preserve"> -
branches/eraser6/EraserService/Eraser.BlackBox/Strings.it.resx
r1973 r2737 118 118 <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 119 119 </resheader> 120 <data name="Checking for status of report {0}..." xml:space="preserve"> 121 <value>Verifica dello stato del report {0}...</value> 120 <data name="Manage BlackBox Reports" xml:space="preserve"> 121 <value>(Untranslated)</value> 122 </data> 123 <data name="Could not delete report {0} because of the following error: {1}" xml:space="preserve"> 124 <value>(Untranslated)</value> 125 </data> 126 <data name="BlackBox" xml:space="preserve"> 127 <value>(Untranslated)</value> 128 </data> 129 <data name="Not submitted" xml:space="preserve"> 130 <value>(Untranslated)</value> 131 </data> 132 <data name="Submitted (Report ID {0})" xml:space="preserve"> 133 <value>(Untranslated)</value> 134 </data> 135 <data name="Eraser BlackBox: Crash Reports Collected" xml:space="preserve"> 136 <value>(Untranslated)</value> 137 </data> 138 <data name="There are crash reports which have yet to be submitted. Click on this balloon to see the list of reports." xml:space="preserve"> 139 <value>(Untranslated)</value> 122 140 </data> 123 141 <data name="Compressing Report {0}: {1:#0.00%}" xml:space="preserve"> … … 126 144 <data name="Uploading Report {0}: {1:#0.00%}" xml:space="preserve"> 127 145 <value>Trasmissione Report {0}: {1:#0.00%}</value> 146 </data> 147 <data name="Checking for solution for {0}..." xml:space="preserve"> 148 <value>(Untranslated)</value> 128 149 </data> 129 150 <data name="Reports submitted successfully." xml:space="preserve"> -
branches/eraser6/EraserService/Eraser.BlackBox/Strings.nl.resx
r1973 r2737 118 118 <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 119 119 </resheader> 120 <data name="Checking for status of report {0}..." xml:space="preserve"> 120 <data name="Manage BlackBox Reports" xml:space="preserve"> 121 <value>(Untranslated)</value> 122 </data> 123 <data name="Could not delete report {0} because of the following error: {1}" xml:space="preserve"> 124 <value>(Untranslated)</value> 125 </data> 126 <data name="BlackBox" xml:space="preserve"> 127 <value>(Untranslated)</value> 128 </data> 129 <data name="Not submitted" xml:space="preserve"> 130 <value>(Untranslated)</value> 131 </data> 132 <data name="Submitted (Report ID {0})" xml:space="preserve"> 133 <value>(Untranslated)</value> 134 </data> 135 <data name="Eraser BlackBox: Crash Reports Collected" xml:space="preserve"> 136 <value>(Untranslated)</value> 137 </data> 138 <data name="There are crash reports which have yet to be submitted. Click on this balloon to see the list of reports." xml:space="preserve"> 121 139 <value>(Untranslated)</value> 122 140 </data> … … 125 143 </data> 126 144 <data name="Uploading Report {0}: {1:#0.00%}" xml:space="preserve"> 145 <value>(Untranslated)</value> 146 </data> 147 <data name="Checking for solution for {0}..." xml:space="preserve"> 127 148 <value>(Untranslated)</value> 128 149 </data> -
branches/eraser6/EraserService/Eraser.BlackBox/Strings.pl.resx
r1973 r2737 118 118 <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 119 119 </resheader> 120 <data name="Checking for status of report {0}..." xml:space="preserve"> 121 <value>Sprawdznie stanu raportu {0}...</value> 120 <data name="Manage BlackBox Reports" xml:space="preserve"> 121 <value>(Untranslated)</value> 122 </data> 123 <data name="Could not delete report {0} because of the following error: {1}" xml:space="preserve"> 124 <value>(Untranslated)</value> 125 </data> 126 <data name="BlackBox" xml:space="preserve"> 127 <value>(Untranslated)</value> 128 </data> 129 <data name="Not submitted" xml:space="preserve"> 130 <value>(Untranslated)</value> 131 </data> 132 <data name="Submitted (Report ID {0})" xml:space="preserve"> 133 <value>(Untranslated)</value> 134 </data> 135 <data name="Eraser BlackBox: Crash Reports Collected" xml:space="preserve"> 136 <value>(Untranslated)</value> 137 </data> 138 <data name="There are crash reports which have yet to be submitted. Click on this balloon to see the list of reports." xml:space="preserve"> 139 <value>(Untranslated)</value> 122 140 </data> 123 141 <data name="Compressing Report {0}: {1:#0.00%}" xml:space="preserve"> … … 126 144 <data name="Uploading Report {0}: {1:#0.00%}" xml:space="preserve"> 127 145 <value>Wysyłanie raportu {0}: {1:#0.00%}</value> 146 </data> 147 <data name="Checking for solution for {0}..." xml:space="preserve"> 148 <value>(Untranslated)</value> 128 149 </data> 129 150 <data name="Reports submitted successfully." xml:space="preserve"> -
branches/eraser6/EraserService/Eraser.BlackBox/Strings.resx
r1973 r2737 118 118 <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 119 119 </resheader> 120 <data name="Checking for status of report {0}..." xml:space="preserve"> 121 <value>Checking for status of report {0}...</value> 120 <data name="Manage BlackBox Reports" xml:space="preserve"> 121 <value>Manage BlackBox Reports</value> 122 </data> 123 <data name="Could not delete report {0} because of the following error: {1}" xml:space="preserve"> 124 <value>Could not delete report {0} because of the following error: {1}</value> 125 </data> 126 <data name="BlackBox" xml:space="preserve"> 127 <value>BlackBox</value> 128 </data> 129 <data name="Not submitted" xml:space="preserve"> 130 <value>Not submitted</value> 131 </data> 132 <data name="Submitted (Report ID {0})" xml:space="preserve"> 133 <value>Submitted (Report ID {0})</value> 134 </data> 135 <data name="Eraser BlackBox: Crash Reports Collected" xml:space="preserve"> 136 <value>Eraser BlackBox: Crash Reports Collected</value> 137 </data> 138 <data name="There are crash reports which have yet to be submitted. Click on this balloon to see the list of reports." xml:space="preserve"> 139 <value>There are crash reports which have yet to be submitted. Click on this balloon to see the list of reports.</value> 122 140 </data> 123 141 <data name="Compressing Report {0}: {1:#0.00%}" xml:space="preserve"> … … 126 144 <data name="Uploading Report {0}: {1:#0.00%}" xml:space="preserve"> 127 145 <value>Uploading Report {0}: {1:#0.00%}</value> 146 </data> 147 <data name="Checking for solution for {0}..." xml:space="preserve"> 148 <value>Checking for solution for {0}...</value> 128 149 </data> 129 150 <data name="Reports submitted successfully." xml:space="preserve"> -
branches/eraser6/EraserService/Eraser.DefaultPlugins/EntropySources/KernelEntropySource.cs
r2622 r2737 105 105 //Currently running threads (dynamic, but not very) 106 106 Process currProcess = Process.GetCurrentProcess(); 107 foreach (ProcessThread thread in currProcess.Threads) 108 result.AddRange(StructToBuffer(thread.Id)); 107 try 108 { 109 foreach (ProcessThread thread in currProcess.Threads) 110 result.AddRange(StructToBuffer(thread.Id)); 111 } 112 catch (InvalidOperationException) 113 { 114 //Swallow, this doesn't mean anything to us. 115 } 109 116 110 117 //Various process statistics … … 199 206 //This happens if a drive is ejected while the loop is running. 200 207 } 208 catch (NotSupportedException) 209 { 210 //Don't bother if this drive doesn't count statistics. 211 } 201 212 } 202 213 -
branches/eraser6/EraserService/Eraser.DefaultPlugins/ErasureTargets/DriveErasureTarget.cs
r2609 r2737 230 230 stepProgress.Total = PhysicalDrive.Size; 231 231 PhysicalDrive.DeleteDriveLayout(); 232 stream = PhysicalDrive.Open(FileAccess.ReadWrite, FileShare.ReadWrite); 232 if (PhysicalDrive.Volumes.Count == 1) 233 { 234 //This could be a removable device where Windows sees an oversized floppy. 235 stream = PhysicalDrive.Volumes[0].Open(FileAccess.ReadWrite, FileShare.ReadWrite); 236 } 237 else if (PhysicalDrive.Volumes.Count > 0) 238 { 239 throw new InvalidOperationException(S._("The partition table on the drive " + 240 "could not be erased.")); 241 } 242 else 243 { 244 stream = PhysicalDrive.Open(FileAccess.ReadWrite, FileShare.ReadWrite); 245 } 233 246 } 234 247 else -
branches/eraser6/EraserService/Eraser.DefaultPlugins/ErasureTargets/DriveErasureTargetConfigurer.cs
r2517 r2737 58 58 new FileSize(PhysicalDrive.Size)); 59 59 } 60 catch (IOException) 61 { 62 Cache = S._("Hard disk {0}", PhysicalDrive.Index); 63 } 60 64 catch (UnauthorizedAccessException) 61 65 { -
branches/eraser6/EraserService/Eraser.DefaultPlugins/ErasureTargets/FileErasureTarget.cs
r2606 r2737 76 76 FileInfo fileInfo = new FileInfo(Path); 77 77 78 if (fileInfo.Exists)78 try 79 79 { 80 80 result.AddRange(GetPathADSes(fileInfo)); 81 81 result.Add(new StreamInfo(Path)); 82 } 83 catch (SharingViolationException) 84 { 85 Logger.Log(S._("Could not list the Alternate Data Streams for file {0} " + 86 "because the file is being used by another process. The file will not " + 87 "be erased.", fileInfo.FullName), LogLevel.Error); 88 } 89 catch (FileNotFoundException) 90 { 91 } 92 catch (DirectoryNotFoundException) 93 { 82 94 } 83 95 -
branches/eraser6/EraserService/Eraser.DefaultPlugins/ErasureTargets/FileSystemObjectErasureTarget.cs
r2606 r2737 129 129 info.FullName, e.Message), LogLevel.Error); 130 130 } 131 catch (IOException e) 132 { 133 //We can get IOExceptions if the drive was disconnected during traversal. 134 //Such an occurrance would be when the user disconnects from a network share. 135 Logger.Log(S._("Could not erase files and subfolders in {0} because {1}", 136 info.FullName, e.Message), LogLevel.Error); 137 } 131 138 } 132 139 … … 135 142 136 143 /// <summary> 137 /// Adds ADSes of the given file to the list, forcing the open handles to the 138 /// files closed if necessary. 139 /// </summary> 140 /// <param name="file">The file to look for ADSes</param> 144 /// Returns the ADSes of the given file, forcing open handles to the files closed 145 /// if necessary. 146 /// </summary> 147 /// <param name="file">The file to look for ADSes.</param> 148 /// <exception cref="SharingViolationException">Thrown when the file cannot be unlocked 149 /// and enumerated for ADSes.</exception> 141 150 protected static StreamInfo[] GetPathADSes(FileInfo file) 142 151 { 152 int attempts = 1; 153 return GetPathADSes(file, ref attempts); 154 } 155 156 /// <summary> 157 /// Returns the ADSes of the given file, forcing open handles to the files closed 158 /// if necessary. 159 /// </summary> 160 /// <param name="file">The file to look for ADSes.</param> 161 /// <param name="attempts">The number of tries to close open handles. Abort after a 162 /// large number of tries (currently 10 attempts)</param> 163 /// <returns>The list of ADSes the file contains.</returns> 164 private static StreamInfo[] GetPathADSes(FileInfo file, ref int attempts) 165 { 143 166 try 144 167 { … … 147 170 catch (FileNotFoundException) 148 171 { 172 return new StreamInfo[0]; 149 173 } 150 174 catch (SharingViolationException) … … 154 178 throw; 155 179 156 StringBuilder processStr = new StringBuilder(); 157 foreach (OpenHandle handle in OpenHandle.Close(file.FullName)) 158 { 159 try 160 { 161 processStr.AppendFormat( 162 System.Globalization.CultureInfo.InvariantCulture, 163 "{0}, ", handle.Process.MainModule.FileName); 164 } 165 catch (System.ComponentModel.Win32Exception) 166 { 167 processStr.AppendFormat( 168 System.Globalization.CultureInfo.InvariantCulture, 169 "Process ID {0}, ", handle.Process.Id); 170 } 171 } 172 173 if (processStr.Length == 0) 174 return GetPathADSes(file); 180 //Retry closing the file 10 times. If we can't do that, we should abort 181 //since we may not be able to get the process information of processes 182 //running with higher privileges. 183 if (OpenHandle.Close(file.FullName).Count == 0 && ++attempts <= 10) 184 return GetPathADSes(file, ref attempts); 175 185 else 176 186 throw; … … 217 227 //Retrieve the list of files to erase. 218 228 List<StreamInfo> paths = GetPaths(); 219 long dataTotal = paths.Sum(x => x.Length); 229 long dataTotal = paths.Sum(delegate(StreamInfo x) { 230 try 231 { 232 return x.Length; 233 } 234 catch (DirectoryNotFoundException) 235 { 236 return 0; 237 } 238 catch (FileNotFoundException) 239 { 240 return 0; 241 } 242 }); 220 243 221 244 //Set the event's current target status. … … 342 365 else 343 366 Logger.Log(S._("The file {0} is a hard link or a symbolic link thus the " + 344 "contents of the file was not erased.", LogLevel.Notice));367 "contents of the file was not erased.", info.FullName), LogLevel.Notice); 345 368 return; 369 } 370 catch (FileNotFoundException) 371 { 372 Logger.Log(S._("The file {0} was not erased because it was " + 373 "deleted before it could be erased.", info.FullName), LogLevel.Information); 374 } 375 catch (DirectoryNotFoundException) 376 { 377 Logger.Log(S._("The file {0} was not erased because the containing " + 378 "directory was deleted before it could be erased.", info.FullName), 379 LogLevel.Information); 346 380 } 347 381 catch (SharingViolationException) … … 359 393 //Either we could not close all instances, or we already tried twice. Report 360 394 //the error. 361 StringBuilder processStr = new StringBuilder(); 362 foreach (OpenHandle handle in remainingHandles) 395 string processes = string.Empty; 363 396 { 364 try 397 StringBuilder processStr = new StringBuilder(); 398 foreach (OpenHandle handle in remainingHandles) 365 399 { 366 processStr.AppendFormat( 367 System.Globalization.CultureInfo.InvariantCulture, 368 "{0}, ", handle.Process.MainModule.FileName); 400 try 401 { 402 processStr.AppendFormat( 403 System.Globalization.CultureInfo.InvariantCulture, 404 "{0}, ", handle.Process.MainModule.FileName); 405 } 406 catch (System.ComponentModel.Win32Exception) 407 { 408 processStr.AppendFormat( 409 System.Globalization.CultureInfo.InvariantCulture, 410 "Process ID {0}, ", handle.Process.Id); 411 } 369 412 } 370 catch (System.ComponentModel.Win32Exception) 413 414 if (processStr.Length > 2) 371 415 { 372 processStr.AppendFormat( 373 System.Globalization.CultureInfo.InvariantCulture, 374 "Process ID {0}, ", handle.Process.Id); 416 processes = processStr.ToString().Remove(processStr.Length - 2).Trim(); 417 } 418 else 419 { 420 processes = S._("(unknown)"); 375 421 } 376 422 } … … 378 424 throw new SharingViolationException(S._( 379 425 "Could not force closure of file \"{0}\" {1}", info.FileName, 380 S._("(locked by {0})", 381 processStr.ToString().Remove(processStr.Length - 2)).Trim()), 382 info.FileName); 426 S._("(locked by {0})", processes))); 383 427 } 384 428 } -
branches/eraser6/EraserService/Eraser.DefaultPlugins/ErasureTargets/FolderErasureTarget.cs
r2606 r2737 147 147 continue; 148 148 149 //Add the size of the file and its alternate data streams 150 result.AddRange(GetPathADSes(file)); 151 152 //And the file itself 153 result.Add(new StreamInfo(file.FullName)); 149 try 150 { 151 //Add the size of the file and its alternate data streams 152 result.AddRange(GetPathADSes(file)); 153 154 //And the file itself 155 result.Add(new StreamInfo(file.FullName)); 156 } 157 catch (FileNotFoundException) 158 { 159 Logger.Log(S._("The file {0} was not erased because it was deleted " + 160 "before it could be erased.", file.FullName), LogLevel.Information); 161 } 162 catch (DirectoryNotFoundException) 163 { 164 Logger.Log(S._("The file {0} was not erased because the containing " + 165 "directory was deleted before it could be erased.", file.FullName), 166 LogLevel.Information); 167 } 168 catch (SharingViolationException) 169 { 170 Logger.Log(S._("Could not list the Alternate Data Streams for file {0} " + 171 "because the file is being used by another process. The file will not " + 172 "be erased.", file.FullName), LogLevel.Error); 173 } 154 174 } 155 175 … … 266 286 DeleteFolder(info, true); 267 287 } 288 catch (DirectoryNotFoundException) 289 { 290 Logger.Log(new LogEntry(S._("The folder {0} was not erased because " + 291 "the containing directory was deleted before it could be erased.", 292 info.FullName), LogLevel.Information)); 293 } 268 294 catch (UnauthorizedAccessException) 269 295 { -
branches/eraser6/EraserService/Eraser.DefaultPlugins/ErasureTargets/RecycleBinErasureTarget.cs
r2606 r2737 141 141 foreach (FileInfo file in GetFiles(directory)) 142 142 { 143 //Add the ADSes 144 result.AddRange(GetPathADSes(file)); 145 146 //Then the file itself 147 result.Add(new StreamInfo(file.FullName)); 143 try 144 { 145 //Add the ADSes 146 result.AddRange(GetPathADSes(file)); 147 148 //Then the file itself 149 result.Add(new StreamInfo(file.FullName)); 150 } 151 catch (FileNotFoundException) 152 { 153 Logger.Log(S._("The file {0} was not erased because it was deleted " + 154 "before it could be erased.", file.FullName), LogLevel.Information); 155 } 156 catch (DirectoryNotFoundException) 157 { 158 Logger.Log(S._("The file {0} was not erased because the containing " + 159 "directory was deleted before it could be erased.", file.FullName), 160 LogLevel.Information); 161 } 162 catch (SharingViolationException) 163 { 164 Logger.Log(S._("Could not list the Alternate Data Streams for file {0} " + 165 "because the file is being used by another process. The file will not " + 166 "be erased.", file.FullName), LogLevel.Error); 167 } 148 168 } 149 169 -
branches/eraser6/EraserService/Eraser.DefaultPlugins/ErasureTargets/SecureMoveErasureTarget.cs
r2606 r2737 123 123 foreach (FileInfo info in files) 124 124 { 125 //Add the alternate data streams 126 result.AddRange(GetPathADSes(info)); 127 128 //And the file itself 129 result.Add(new StreamInfo(info.FullName)); 125 try 126 { 127 //Add the alternate data streams 128 result.AddRange(GetPathADSes(info)); 129 130 //And the file itself 131 result.Add(new StreamInfo(info.FullName)); 132 } 133 catch (SharingViolationException) 134 { 135 Logger.Log(S._("Could not list the Alternate Data Streams for file {0} " + 136 "because the file is being used by another process. The file will not " + 137 "be erased.", info.FullName), LogLevel.Error); 138 } 139 catch (FileNotFoundException) 140 { 141 } 142 catch (DirectoryNotFoundException) 143 { 144 } 130 145 } 131 146 -
branches/eraser6/EraserService/Eraser.DefaultPlugins/FileSystems/Fat.cs
r2516 r2737 75 75 { 76 76 using (FileStream stream = info.Open(FileAccess.ReadWrite, FileShare.ReadWrite)) 77 using (FatApi api = GetFatApi(info, stream)) 77 78 { 78 79 int directoriesCleaned = 0; 79 FatApi api = GetFatApi(info, stream);80 80 HashSet<uint> eraseQueueClusters = new HashSet<uint>(); 81 81 List<FatDirectoryEntry> eraseQueue = new List<FatDirectoryEntry>(); 82 {83 FatDirectoryEntry entry = api.LoadDirectory(string.Empty);84 eraseQueue.Add(entry);85 eraseQueueClusters.Add(entry.Cluster);86 }87 82 88 83 try 89 84 { 85 { 86 FatDirectoryEntry entry = api.LoadDirectory(string.Empty); 87 eraseQueue.Add(entry); 88 eraseQueueClusters.Add(entry.Cluster); 89 } 90 90 91 while (eraseQueue.Count != 0) 91 92 { … … 94 95 95 96 FatDirectoryBase currentDir = api.LoadDirectory(eraseQueue[0].FullName); 97 eraseQueue[0].Dispose(); 96 98 eraseQueue.RemoveAt(0); 97 99 … … 118 120 "the volume is currently in use.")); 119 121 } 122 finally 123 { 124 foreach (FatDirectoryEntry entry in eraseQueue) 125 entry.Dispose(); 126 } 120 127 } 121 128 } -
branches/eraser6/EraserService/Eraser.DefaultPlugins/FileSystems/Windows.cs
r2559 r2737 139 139 } 140 140 141 StringBuilder processStr = new StringBuilder(); 142 foreach (OpenHandle handle in OpenHandle.Close(info.FullName)) 141 //Either we could not close all instances, or we already tried twice. Report 142 //the error. 143 string processes = string.Empty; 143 144 { 144 try 145 StringBuilder processStr = new StringBuilder(); 146 foreach (OpenHandle handle in OpenHandle.Close(info.FullName)) 145 147 { 146 processStr.AppendFormat( 147 System.Globalization.CultureInfo.InvariantCulture, 148 "{0}, ", handle.Process.MainModule.FileName); 148 try 149 { 150 processStr.AppendFormat( 151 System.Globalization.CultureInfo.InvariantCulture, 152 "{0}, ", handle.Process.MainModule.FileName); 153 } 154 catch (System.ComponentModel.Win32Exception) 155 { 156 processStr.AppendFormat( 157 System.Globalization.CultureInfo.InvariantCulture, 158 "Process ID {0}, ", handle.Process.Id); 159 } 149 160 } 150 catch (System.ComponentModel.Win32Exception) 161 162 if (processStr.Length > 2) 151 163 { 152 processStr.AppendFormat( 153 System.Globalization.CultureInfo.InvariantCulture, 154 "Process ID {0}, ", handle.Process.Id); 164 processes = processStr.ToString().Remove(processStr.Length - 2).Trim(); 165 } 166 else 167 { 168 processes = S._("(unknown)"); 155 169 } 156 170 } 157 171 158 if (processStr.Length != 0) 159 Logger.Log(S._("Could not force closure of file \"{0}\" {1}", 160 info.FullName, S._("(locked by {0})", 161 processStr.ToString().Remove(processStr.Length - 2)).Trim()), 162 LogLevel.Error); 172 throw new SharingViolationException(S._( 173 "Could not force closure of file \"{0}\" {1}", info.FullName, 174 S._("(locked by {0})", processes))); 163 175 } 164 176 … … 262 274 long amountToCopy = Math.Min(stream.Length, 263 275 Math.Min(4 * 1024 * 1024, shadowFileInfo.Length)); 264 using (FileStream shadowFileStream = shadowFileInfo.OpenRead()) 276 using (FileStream shadowFileStream = shadowFileInfo.Open( 277 FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) 265 278 { 266 279 while (stream.Position < amountToCopy) -
branches/eraser6/EraserService/Eraser.DefaultPlugins/Strings.en.resx
r2615 r2737 166 166 <value>The file {0} is currently in use and cannot be removed.</value> 167 167 </data> 168 <data name="(unknown)" xml:space="preserve"> 169 <value>(unknown)</value> 170 </data> 168 171 <data name="Could not force closure of file \"{0}\" {1}(locked by {0})" xml:space="preserve"> 169 172 <value>Could not force closure of file \"{0}\" {1}(locked by {0})</value> … … 220 223 <value>The program does not have the required permissions to erase the disk.</value> 221 224 </data> 225 <data name="The partition table on the drive could not be erased." xml:space="preserve"> 226 <value>The partition table on the drive could not be erased.</value> 227 </data> 222 228 <data name="The Drive erasure target requires a volume or physical drive selected for erasure." xml:space="preserve"> 223 229 <value>The Drive erasure target requires a volume or physical drive selected for erasure.</value> … … 247 253 <value>File</value> 248 254 </data> 255 <data name="Could not list the Alternate Data Streams for file {0} because the file is being used by another process. The file will not be erased." xml:space="preserve"> 256 <value>Could not list the Alternate Data Streams for file {0} because the file is being used by another process. The file will not be erased.</value> 257 </data> 249 258 <data name="Invalid file path" xml:space="preserve"> 250 259 <value>Invalid file path</value> … … 265 274 <value>The file {0} is a hard link or a symbolic link thus the contents of the file was not erased.</value> 266 275 </data> 276 <data name="The file {0} was not erased because it was deleted before it could be erased." xml:space="preserve"> 277 <value>The file {0} was not erased because it was deleted before it could be erased.</value> 278 </data> 279 <data name="The file {0} was not erased because the containing directory was deleted before it could be erased." xml:space="preserve"> 280 <value>The file {0} was not erased because the containing directory was deleted before it could be erased.</value> 281 </data> 267 282 <data name="Files in Folder" xml:space="preserve"> 268 283 <value>Files in Folder</value> … … 271 286 <value>Removing folders...</value> 272 287 </data> 288 <data name="The folder {0} was not erased because the containing directory was deleted before it could be erased." xml:space="preserve"> 289 <value>The folder {0} was not erased because the containing directory was deleted before it could be erased.</value> 290 </data> 273 291 <data name="The folder {0} could not be deleted because the folder's permissions prevents the deletion of the folder." xml:space="preserve"> 274 292 <value>The folder {0} could not be deleted because the folder's permissions prevents the deletion of the folder.</value> -
branches/eraser6/EraserService/Eraser.DefaultPlugins/Strings.it.resx
r2615 r2737 166 166 <value>Il file {0} è attualmente in uso e non può essere rimosso.</value> 167 167 </data> 168 <data name="(unknown)" xml:space="preserve"> 169 <value>(Untranslated)</value> 170 </data> 168 171 <data name="Could not force closure of file \"{0}\" {1}(locked by {0})" xml:space="preserve"> 169 172 <value>Impossibile forzare la chiusura del file \"{0}\" {1}(in uso da {0})</value> … … 220 223 <value>(Untranslated)</value> 221 224 </data> 225 <data name="The partition table on the drive could not be erased." xml:space="preserve"> 226 <value>(Untranslated)</value> 227 </data> 222 228 <data name="The Drive erasure target requires a volume or physical drive selected for erasure." xml:space="preserve"> 223 229 <value>(Untranslated)</value> … … 247 253 <value>(Untranslated)</value> 248 254 </data> 255 <data name="Could not list the Alternate Data Streams for file {0} because the file is being used by another process. The file will not be erased." xml:space="preserve"> 256 <value>(Untranslated)</value> 257 </data> 249 258 <data name="Invalid file path" xml:space="preserve"> 250 259 <value>Percorso del file non valido</value> … … 265 274 <value>(Untranslated)</value> 266 275 </data> 276 <data name="The file {0} was not erased because it was deleted before it could be erased." xml:space="preserve"> 277 <value>(Untranslated)</value> 278 </data> 279 <data name="The file {0} was not erased because the containing directory was deleted before it could be erased." xml:space="preserve"> 280 <value>(Untranslated)</value> 281 </data> 267 282 <data name="Files in Folder" xml:space="preserve"> 268 283 <value>File in cartella</value> … … 271 286 <value>Pulizia cartelle...</value> 272 287 </data> 288 <data name="The folder {0} was not erased because the containing directory was deleted before it could be erased." xml:space="preserve"> 289 <value>(Untranslated)</value> 290 </data> 273 291 <data name="The folder {0} could not be deleted because the folder's permissions prevents the deletion of the folder." xml:space="preserve"> 274 292 <value>(Untranslated)</value> -
branches/eraser6/EraserService/Eraser.DefaultPlugins/Strings.nl.resx
r2615 r2737 166 166 <value>(Untranslated)</value> 167 167 </data> 168 <data name="(unknown)" xml:space="preserve"> 169 <value>(Untranslated)</value> 170 </data> 168 171 <data name="Could not force closure of file \"{0}\" {1}(locked by {0})" xml:space="preserve"> 169 172 <value>(Untranslated)</value> … … 220 223 <value>(Untranslated)</value> 221 224 </data> 225 <data name="The partition table on the drive could not be erased." xml:space="preserve"> 226 <value>(Untranslated)</value> 227 </data> 222 228 <data name="The Drive erasure target requires a volume or physical drive selected for erasure." xml:space="preserve"> 223 229 <value>(Untranslated)</value> … … 247 253 <value>(Untranslated)</value> 248 254 </data> 255 <data name="Could not list the Alternate Data Streams for file {0} because the file is being used by another process. The file will not be erased." xml:space="preserve"> 256 <value>(Untranslated)</value> 257 </data> 249 258 <data name="Invalid file path" xml:space="preserve"> 250 259 <value>(Untranslated)</value> … … 265 274 <value>(Untranslated)</value> 266 275 </data> 276 <data name="The file {0} was not erased because it was deleted before it could be erased." xml:space="preserve"> 277 <value>(Untranslated)</value> 278 </data> 279 <data name="The file {0} was not erased because the containing directory was deleted before it could be erased." xml:space="preserve"> 280 <value>(Untranslated)</value> 281 </data> 267 282 <data name="Files in Folder" xml:space="preserve"> 268 283 <value>(Untranslated)</value> … … 271 286 <value>(Untranslated)</value> 272 287 </data> 288 <data name="The folder {0} was not erased because the containing directory was deleted before it could be erased." xml:space="preserve"> 289 <value>(Untranslated)</value> 290 </data> 273 291 <data name="The folder {0} could not be deleted because the folder's permissions prevents the deletion of the folder." xml:space="preserve"> 274 292 <value>(Untranslated)</value> -
branches/eraser6/EraserService/Eraser.DefaultPlugins/Strings.pl.resx
r2615 r2737 166 166 <value>Plik {0} jest w użyciu i nie można go usunąć.</value> 167 167 </data> 168 <data name="(unknown)" xml:space="preserve"> 169 <value>(Untranslated)</value> 170 </data> 168 171 <data name="Could not force closure of file \"{0}\" {1}(locked by {0})" xml:space="preserve"> 169 172 <value>Nie można wymusić zamknięcia pliku \"{0}\" {1}(zablokowany przez {0})</value> … … 220 223 <value>(Untranslated)</value> 221 224 </data> 225 <data name="The partition table on the drive could not be erased." xml:space="preserve"> 226 <value>(Untranslated)</value> 227 </data> 222 228 <data name="The Drive erasure target requires a volume or physical drive selected for erasure." xml:space="preserve"> 223 229 <value>(Untranslated)</value> … … 247 253 <value>(Untranslated)</value> 248 254 </data> 255 <data name="Could not list the Alternate Data Streams for file {0} because the file is being used by another process. The file will not be erased." xml:space="preserve"> 256 <value>(Untranslated)</value> 257 </data> 249 258 <data name="Invalid file path" xml:space="preserve"> 250 259 <value>(Untranslated)</value> … … 265 274 <value>(Untranslated)</value> 266 275 </data> 276 <data name="The file {0} was not erased because it was deleted before it could be erased." xml:space="preserve"> 277 <value>(Untranslated)</value> 278 </data> 279 <data name="The file {0} was not erased because the containing directory was deleted before it could be erased." xml:space="preserve"> 280 <value>(Untranslated)</value> 281 </data> 267 282 <data name="Files in Folder" xml:space="preserve"> 268 283 <value>(Untranslated)</value> 269 284 </data> 270 285 <data name="Removing folders..." xml:space="preserve"> 286 <value>(Untranslated)</value> 287 </data> 288 <data name="The folder {0} was not erased because the containing directory was deleted before it could be erased." xml:space="preserve"> 271 289 <value>(Untranslated)</value> 272 290 </data> -
branches/eraser6/EraserService/Eraser.DefaultPlugins/Strings.resx
r2615 r2737 166 166 <value>The file {0} is currently in use and cannot be removed.</value> 167 167 </data> 168 <data name="(unknown)" xml:space="preserve"> 169 <value>(unknown)</value> 170 </data> 168 171 <data name="Could not force closure of file \"{0}\" {1}(locked by {0})" xml:space="preserve"> 169 172 <value>Could not force closure of file \"{0}\" {1}(locked by {0})</value> … … 220 223 <value>The program does not have the required permissions to erase the disk.</value> 221 224 </data> 225 <data name="The partition table on the drive could not be erased." xml:space="preserve"> 226 <value>The partition table on the drive could not be erased.</value> 227 </data> 222 228 <data name="The Drive erasure target requires a volume or physical drive selected for erasure." xml:space="preserve"> 223 229 <value>The Drive erasure target requires a volume or physical drive selected for erasure.</value> … … 247 253 <value>File</value> 248 254 </data> 255 <data name="Could not list the Alternate Data Streams for file {0} because the file is being used by another process. The file will not be erased." xml:space="preserve"> 256 <value>Could not list the Alternate Data Streams for file {0} because the file is being used by another process. The file will not be erased.</value> 257 </data> 249 258 <data name="Invalid file path" xml:space="preserve"> 250 259 <value>Invalid file path</value> … … 265 274 <value>The file {0} is a hard link or a symbolic link thus the contents of the file was not erased.</value> 266 275 </data> 276 <data name="The file {0} was not erased because it was deleted before it could be erased." xml:space="preserve"> 277 <value>The file {0} was not erased because it was deleted before it could be erased.</value> 278 </data> 279 <data name="The file {0} was not erased because the containing directory was deleted before it could be erased." xml:space="preserve"> 280 <value>The file {0} was not erased because the containing directory was deleted before it could be erased.</value> 281 </data> 267 282 <data name="Files in Folder" xml:space="preserve"> 268 283 <value>Files in Folder</value> … … 271 286 <value>Removing folders...</value> 272 287 </data> 288 <data name="The folder {0} was not erased because the containing directory was deleted before it could be erased." xml:space="preserve"> 289 <value>The folder {0} was not erased because the containing directory was deleted before it could be erased.</value> 290 </data> 273 291 <data name="The folder {0} could not be deleted because the folder's permissions prevents the deletion of the folder." xml:space="preserve"> 274 292 <value>The folder {0} could not be deleted because the folder's permissions prevents the deletion of the folder.</value> -
branches/eraser6/EraserService/Eraser.Manager/Strings.en.resx
r2572 r2737 119 119 </resheader> 120 120 <data name="No suitable hash algorithms were found on this computer." xml:space="preserve"> 121 <value> (Untranslated)</value>121 <value>No suitable hash algorithms were found on this computer.</value> 122 122 </data> 123 123 <data name="Running on restart" xml:space="preserve"> -
branches/eraser6/EraserService/Eraser.Manager/Task.cs
r2736 r2737 471 471 throw; 472 472 } 473 catch (NotSupportedException e) 474 { 475 //This is thrown whenever we try to erase files on an unsupported 476 //filesystem. 477 Logger.Log(e.Message, LogLevel.Error); 478 } 479 catch (UnauthorizedAccessException e) 480 { 481 //The OS denied us access to erasing the file. 482 Logger.Log(e.Message, LogLevel.Error); 483 } 484 catch (PathTooLongException e) 485 { 486 //Until we have code to deal with paths using NT names, we can't 487 //do much about it. 488 Logger.Log(e.Message, LogLevel.Error); 489 } 473 490 catch (SharingViolationException) 474 491 { -
branches/eraser6/EraserService/Eraser.Plugins/Eraser.Plugins.csproj
r2506 r2737 57 57 <Compile Include="ExtensionPoints\IErasureTarget.cs" /> 58 58 <Compile Include="ExtensionPoints\IFileSystem.cs" /> 59 <Compile Include="ExtensionPoints\INotifier.cs" /> 59 60 <Compile Include="ExtensionPoints\IPrng.cs" /> 60 61 <Compile Include="IConfigurer.cs" /> … … 75 76 <Compile Include="Registrars\ErasureTargetFactoryRegistrar.cs" /> 76 77 <Compile Include="Registrars\FileSystemRegistrar.cs" /> 78 <Compile Include="Registrars\NotifierRegistrar.cs" /> 77 79 <Compile Include="Registrars\PrngRegistrar.cs" /> 78 80 <Compile Include="Settings.cs" /> -
branches/eraser6/EraserService/Eraser.Plugins/Host.cs
r2516 r2737 96 96 FileSystems = new FileSystemRegistrar(); 97 97 ClientTools = new ClientToolRegistrar(); 98 Notifiers = new NotifierRegistrar(); 98 99 } 99 100 … … 232 233 233 234 /// <summary> 234 /// The global instance of the Client Tools 235 /// The global instance of the Client Tools Registrar. 235 236 /// </summary> 236 237 public ClientToolRegistrar ClientTools 238 { 239 get; 240 private set; 241 } 242 243 /// <summary> 244 /// The global instance of the Notifier Registrar. 245 /// </summary> 246 public NotifierRegistrar Notifiers 237 247 { 238 248 get; … … 283 293 if (!LoadPlugin(new AssemblyName(name))) 284 294 throw new FileLoadException(S._("The required Core plugin {0} could not be " + 285 "loaded. Repair the Eraser installation and try again." ));295 "loaded. Repair the Eraser installation and try again.", name)); 286 296 } 287 297 -
branches/eraser6/EraserService/Eraser.Plugins/Registrars/FileSystemRegistrar.cs
r2518 r2737 45 45 get 46 46 { 47 if (volume == null) 48 throw new ArgumentNullException("volume"); 49 47 50 foreach (IFileSystem filesystem in this) 48 51 if (filesystem.Name.ToUpperInvariant() == -
branches/eraser6/EraserService/Eraser.Shell/CtxMenu.cpp
r2531 r2737 301 301 302 302 //Insert the submenu into the Context menu provided by Explorer. 303 if (GetMenuItemCount(hSubmenu) > 0) 303 304 { 304 305 MENUITEMINFO mii = { sizeof(MENUITEMINFO) }; -
branches/eraser6/EraserService/Eraser.Shell/CtxMenu.h
r2516 r2737 42 42 { 43 43 public: 44 CCtxMenu() 45 { 46 } 44 CCtxMenu() {} 45 virtual ~CCtxMenu() {} 47 46 48 47 /// The place where the context menu extension was invoked. -
branches/eraser6/EraserService/Eraser.Util.Native/Fat12Or16Api.cpp
r2516 r2737 40 40 if (info->VolumeFormat != L"FAT12" && info->VolumeFormat != "FAT16") 41 41 throw gcnew ArgumentException(S::_(L"The volume provided is not a FAT12 or FAT16 volume.")); 42 } 43 44 Fat12Or16Api::!Fat12Or16Api() 45 { 46 if (Fat != NULL) 47 { 48 delete[] Fat; 49 Fat = NULL; 50 } 42 51 } 43 52 … … 126 135 } 127 136 137 Fat12Or16Api::RootDirectory::!RootDirectory() 138 { 139 if (Directory != NULL) 140 { 141 delete[] Directory; 142 Directory = NULL; 143 DirectorySize = 0; 144 } 145 } 146 128 147 void Fat12Or16Api::RootDirectory::ReadDirectory() 129 148 { -
branches/eraser6/EraserService/Eraser.Util.Native/Fat32Api.cpp
r2516 r2737 40 40 if (info->VolumeFormat != L"FAT32") 41 41 throw gcnew ArgumentException(S::_(L"The volume provided is not a FAT32 volume.")); 42 } 43 44 Fat32Api::!Fat32Api() 45 { 46 if (Fat != NULL) 47 { 48 delete[] Fat; 49 Fat = NULL; 50 } 42 51 } 43 52 -
branches/eraser6/EraserService/Eraser.Util.Native/FatApi.cpp
r2516 r2737 70 70 } 71 71 72 FatApi::!FatApi() 73 { 74 if (BootSector != NULL) 75 { 76 delete BootSector; 77 BootSector = NULL; 78 } 79 } 80 72 81 FatDirectoryBase^ FatApi::LoadDirectory(String^ directory) 73 82 { … … 344 353 } 345 354 355 FatDirectory::!FatDirectory() 356 { 357 if (Directory != NULL) 358 { 359 delete[] Directory; 360 Directory = NULL; 361 DirectorySize = 0; 362 } 363 } 364 346 365 void FatDirectory::ReadDirectory() 347 366 { -
branches/eraser6/EraserService/Eraser.Util.Native/FatApi.h
r2516 r2737 51 51 FatApi(IO::Stream^ stream); 52 52 53 /// Destructor. 54 virtual ~FatApi() { this->!FatApi(); } 55 56 /// Finalizer. 57 !FatApi(); 58 53 59 public: 54 60 /// <summary> … … 175 181 public ref class FatDirectoryEntry 176 182 { 183 public: 184 virtual ~FatDirectoryEntry() {} 185 177 186 public: 178 187 /// <summary> … … 257 266 FatDirectoryBase(String^ name, FatDirectoryBase^ parent, unsigned cluster); 258 267 268 virtual ~FatDirectoryBase() {} 269 259 270 public: 260 271 /// <summary> … … 345 356 FatDirectory(String^ name, FatDirectoryBase^ parent, unsigned cluster, FatApi^ api); 346 357 358 /// Destructor. 359 virtual ~FatDirectory() { this->!FatDirectory(); } 360 361 /// Finalizer. 362 !FatDirectory(); 363 347 364 virtual void ReadDirectory() override; 348 365 virtual void WriteDirectory() override; … … 357 374 Fat12Or16Api(VolumeInfo^ info); 358 375 Fat12Or16Api(VolumeInfo^ info, IO::Stream^ stream); 376 377 virtual ~Fat12Or16Api() { this->!Fat12Or16Api(); } 378 !Fat12Or16Api(); 359 379 360 380 public: … … 372 392 public: 373 393 RootDirectory(Fat12Or16Api^ api); 394 395 virtual ~RootDirectory() { this->!RootDirectory(); } 396 !RootDirectory(); 374 397 375 398 protected: … … 430 453 Fat32Api(VolumeInfo^ info); 431 454 Fat32Api(VolumeInfo^ info, IO::Stream^ stream); 455 456 virtual ~Fat32Api() { this->!Fat32Api(); } 457 !Fat32Api(); 432 458 433 459 public: -
branches/eraser6/EraserService/Eraser.Util.Native/OpenHandle.cpp
r2516 r2737 43 43 while (!NT_SUCCESS(result)); 44 44 45 if (!NT_SUCCESS(result) )45 if (!NT_SUCCESS(result) || handlesBuffer.size() < sizeof(SYSTEM_HANDLES)) 46 46 throw gcnew InvalidOperationException("The list of open system handles could not be retrieved."); 47 47 } -
branches/eraser6/EraserService/Eraser.Util/ExtensionClasses/SharingViolationException.cs
r2516 r2737 31 31 /// A file sharing violation exception. 32 32 /// </summary> 33 public class SharingViolationException : IOException33 public class SharingViolationException : FileLoadException 34 34 { 35 35 /// <summary> -
branches/eraser6/EraserService/Eraser.Util/PostDataBuilder.cs
r2516 r2737 87 87 } 88 88 89 public void AddParts(ICollection<PostDataField> fields) 90 { 91 foreach (PostDataField field in fields) 92 AddPart(field); 93 } 94 89 95 /// <summary> 90 96 /// Gets a stream with which to read the data from. -
branches/eraser6/EraserService/Eraser.Util/Strings.en.resx
r2558 r2737 149 149 </data> 150 150 <data name="The folder {0} cannot be opened for writing." xml:space="preserve"> 151 <value> (Untranslated)</value>151 <value>The folder {0} cannot be opened for writing.</value> 152 152 </data> 153 153 </root> -
branches/eraser6/EraserService/Eraser.Util/VolumeInfo.cs
r2560 r2737 590 590 public bool IsMounted 591 591 { 592 get { return MountPoints.Count != 0; } 592 get 593 { 594 try 595 { 596 return MountPoints.Count != 0; 597 } 598 catch (FileNotFoundException) 599 { 600 return false; 601 } 602 } 593 603 } 594 604 … … 612 622 NativeMethods.VOLUME_DISK_EXTENTS header; 613 623 614 if(!NativeMethods.DeviceIoControl(handle,624 while (!NativeMethods.DeviceIoControl(handle, 615 625 NativeMethods.IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS, IntPtr.Zero, 0, 616 626 buffer, (uint)bufferSize, out returnSize, IntPtr.Zero)) 617 627 { 618 628 int error = Marshal.GetLastWin32Error(); 619 if (error == Win32ErrorCode.InvalidFunction) 629 if (error == Win32ErrorCode.InvalidFunction || 630 error == Win32ErrorCode.NotSupported) 620 631 return null; 621 632 else if (error != Win32ErrorCode.MoreData) 622 633 throw Win32ErrorCode.GetExceptionForWin32Error(error); 623 634 624 //Calculate the size of the buffer required 625 header = (NativeMethods.VOLUME_DISK_EXTENTS) 626 Marshal.PtrToStructure(buffer, 627 typeof(NativeMethods.VOLUME_DISK_EXTENTS)); 628 Marshal.FreeHGlobal(buffer); 629 bufferSize += (int)(header.NumberOfDiskExtents - 1) * 630 Marshal.SizeOf(typeof(NativeMethods.DISK_EXTENT)); 631 buffer = Marshal.AllocHGlobal(bufferSize); 632 633 if (!NativeMethods.DeviceIoControl(handle, 634 NativeMethods.IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS, IntPtr.Zero, 0, 635 buffer, (uint)bufferSize, out returnSize, IntPtr.Zero)) 636 { 637 throw Win32ErrorCode.GetExceptionForWin32Error( 638 Marshal.GetLastWin32Error()); 639 } 635 buffer = Marshal.ReAllocHGlobal(buffer, (IntPtr)(bufferSize *= 2)); 640 636 } 641 637 … … 881 877 IntPtr.Zero, 0, IntPtr.Zero, 0, out result, IntPtr.Zero)) 882 878 { 883 throw new IOException("Could not unlock volume."); 879 throw new IOException("Could not unlock volume.", 880 new Win32Exception(Marshal.GetLastWin32Error())); 884 881 } 885 882 -
branches/eraser6/EraserService/Eraser.Util/Win32ErrorCodes.cs
r2516 r2737 67 67 case RequestAborted: return new OperationCanceledException(); 68 68 case SharingViolation: return new SharingViolationException(); 69 case BadCommand: return new NotSupportedException(); 70 case BadArguments: return new ArgumentException(); 69 71 } 70 72 … … 96 98 public const int RequestAborted = 1235; 97 99 public const int NotAReparsePoint = 4390; 100 public const int BadCommand = 22; 101 public const int NotSupported = 50; 102 public const int BadArguments = 160; 98 103 } 99 104 } -
branches/eraser6/EraserService/Eraser/MainForm.Designer.cs
r2516 r2737 70 70 this.tbTools = new System.Windows.Forms.ToolStripMenuItem(); 71 71 this.tbToolsDropDown = new System.Windows.Forms.ToolStripMenuItem(); 72 this.tbToolsMenu = new System.Windows.Forms.ContextMenuStrip(this.components); 72 73 this.tbSettings = new System.Windows.Forms.ToolStripMenuItem(); 73 74 this.tbHelp = new System.Windows.Forms.ToolStripMenuItem(); … … 78 79 this.checkForUpdatesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 79 80 this.eraserLogo = new System.Windows.Forms.PictureBox(); 80 this.tbToolsMenu = new System.Windows.Forms.ContextMenuStrip(this.components);81 81 this.notificationMenu.SuspendLayout(); 82 82 this.ToolBar.SuspendLayout(); … … 104 104 this.notificationIcon.ContextMenuStrip = this.notificationMenu; 105 105 resources.ApplyResources(this.notificationIcon, "notificationIcon"); 106 this.notificationIcon.BalloonTipClicked += new System.EventHandler(this.notificationIcon_BalloonTipClicked); 107 this.notificationIcon.BalloonTipClosed += new System.EventHandler(this.notificationIcon_BalloonTipClosed); 108 this.notificationIcon.BalloonTipShown += new System.EventHandler(this.notificationIcon_BalloonTipShown); 106 109 this.notificationIcon.DoubleClick += new System.EventHandler(this.openToolStripMenuItem_Click); 107 110 // … … 178 181 this.importTaskListToolStripMenuItem}); 179 182 this.tbScheduleMenu.Name = "tbScheduleMenu"; 183 this.tbScheduleMenu.OwnerItem = this.tbScheduleDropDown; 180 184 resources.ApplyResources(this.tbScheduleMenu, "tbScheduleMenu"); 181 185 // … … 217 221 this.tbToolsDropDown.Name = "tbToolsDropDown"; 218 222 // 223 // tbToolsMenu 224 // 225 this.tbToolsMenu.Name = "tbToolsMenu"; 226 this.tbToolsMenu.OwnerItem = this.tbToolsDropDown; 227 resources.ApplyResources(this.tbToolsMenu, "tbToolsMenu"); 228 // 219 229 // tbSettings 220 230 // … … 249 259 this.aboutEraserToolStripMenuItem}); 250 260 this.tbHelpMenu.Name = "tbHelpMenu"; 261 this.tbHelpMenu.OwnerItem = this.tbHelpDropDown; 251 262 resources.ApplyResources(this.tbHelpMenu, "tbHelpMenu"); 252 263 // … … 278 289 this.eraserLogo.TabStop = false; 279 290 this.eraserLogo.Click += new System.EventHandler(this.eraserLogo_Click); 280 //281 // tbToolsMenu282 //283 this.tbToolsMenu.Name = "tbToolsMenu";284 resources.ApplyResources(this.tbToolsMenu, "tbToolsMenu");285 291 // 286 292 // MainForm -
branches/eraser6/EraserService/Eraser/MainForm.cs
r2606 r2737 43 43 namespace Eraser 44 44 { 45 public partial class MainForm : Form 45 public partial class MainForm : Form, INotificationSink 46 46 { 47 47 private BasePanel CurrPage; … … 72 72 } 73 73 74 //We also need to see if we have any notifier classes we need to register 75 foreach (INotifier notifier in Host.Instance.Notifiers) 76 notifier.Sink = this; 77 Host.Instance.Notifiers.Registered += Notifier_Registered; 78 74 79 //For every task we need to register the Task Started and Task Finished 75 80 //event handlers for progress notifications … … 98 103 } 99 104 105 #region Notifications handling code 106 /// <summary> 107 /// Stores information about pending notifications. 108 /// </summary> 109 private struct NotificationInfo 110 { 111 public INotifier Source; 112 public int Timeout; 113 public ToolTipIcon Icon; 114 public string Title; 115 public string Message; 116 } 117 100 118 /// <summary> 101 119 /// Diplays the given title, message and icon as a system notification area balloon. … … 106 124 public void ShowNotificationBalloon(string title, string message, ToolTipIcon icon) 107 125 { 108 notificationIcon.BalloonTipTitle = title; 109 notificationIcon.BalloonTipText = message; 110 notificationIcon.BalloonTipIcon = icon; 111 notificationIcon.ShowBalloonTip(0); 112 } 126 NotificationInfo info; 127 info.Source = null; 128 info.Timeout = 0; 129 info.Icon = icon; 130 info.Title = title; 131 info.Message = message; 132 133 NotificationsQueue.Add(info); 134 135 //Can we show the notification immediately? 136 if (NotificationsQueue.Count == 1) 137 ShowNextNotification(); 138 } 139 140 public void ShowNotification(INotifier source, int timeout, ToolTipIcon icon, 141 string title, string message) 142 { 143 NotificationInfo info; 144 info.Source = source; 145 info.Timeout = timeout; 146 info.Icon = icon; 147 info.Title = title; 148 info.Message = message; 149 150 NotificationsQueue.Add(info); 151 152 //Can we show the notification immediately? 153 if (NotificationsQueue.Count == 1) 154 ShowNextNotification(); 155 } 156 157 private void Notifier_Registered(object sender, EventArgs e) 158 { 159 ((INotifier)sender).Sink = this; 160 } 161 162 private void ShowNextNotification() 163 { 164 Debug.Assert(NotificationsQueue.Count != 0); 165 NotificationInfo info = NotificationsQueue[0]; 166 notificationIcon.ShowBalloonTip(info.Timeout, info.Title, info.Message, info.Icon); 167 } 168 169 private void notificationIcon_BalloonTipShown(object sender, EventArgs e) 170 { 171 Debug.Assert(NotificationsQueue.Count != 0); 172 if (NotificationsQueue[0].Source != null) 173 NotificationsQueue[0].Source.Shown(sender, e); 174 } 175 176 private void notificationIcon_BalloonTipClosed(object sender, EventArgs e) 177 { 178 Debug.Assert(NotificationsQueue.Count != 0); 179 180 if (NotificationsQueue[0].Source != null) 181 NotificationsQueue[0].Source.Closed(sender, e); 182 NotificationsQueue.RemoveAt(0); 183 184 if (NotificationsQueue.Count > 0) 185 ShowNextNotification(); 186 } 187 188 private void notificationIcon_BalloonTipClicked(object sender, EventArgs e) 189 { 190 Debug.Assert(NotificationsQueue.Count != 0); 191 if (NotificationsQueue[0].Source != null) 192 NotificationsQueue[0].Source.Clicked(sender, e); 193 } 194 195 /// <summary> 196 /// The queue holding the list of notifications to be displayed sequentially. 197 /// The notification being displayed is the first item in the list. 198 /// </summary> 199 private List<NotificationInfo> NotificationsQueue = new List<NotificationInfo>(); 200 #endregion 113 201 114 202 /// <summary> -
branches/eraser6/EraserService/Eraser/MainForm.resx
r2511 r2737 160 160 <value>801, 17</value> 161 161 </metadata> 162 <data name="openEraserToolStripMenuItem.Font" type="System.Drawing.Font, System.Drawing">163 <value>Microsoft Sans Serif, 9pt, style=Bold</value>164 </data>165 <data name="openEraserToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">166 <value>192, 22</value>167 </data>168 <data name="openEraserToolStripMenuItem.Text" xml:space="preserve">169 <value>Open Eraser</value>170 </data>171 <data name="toolStripMenuItem1.Size" type="System.Drawing.Size, System.Drawing">172 <value>189, 6</value>173 </data>174 <data name="hideWhenMinimisedToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">175 <value>192, 22</value>176 </data>177 <data name="hideWhenMinimisedToolStripMenuItem.Text" xml:space="preserve">178 <value>Hide When Minimised</value>179 </data>180 <data name="exitToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">181 <value>192, 22</value>182 </data>183 <data name="exitToolStripMenuItem.Text" xml:space="preserve">184 <value>E&xit Eraser</value>185 </data>186 162 <data name="notificationMenu.Size" type="System.Drawing.Size, System.Drawing"> 187 163 <value>193, 76</value> … … 1759 1735 <value>True</value> 1760 1736 </data> 1737 <data name="openEraserToolStripMenuItem.Font" type="System.Drawing.Font, System.Drawing"> 1738 <value>Microsoft Sans Serif, 9pt, style=Bold</value> 1739 </data> 1740 <data name="openEraserToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing"> 1741 <value>192, 22</value> 1742 </data> 1743 <data name="openEraserToolStripMenuItem.Text" xml:space="preserve"> 1744 <value>Open Eraser</value> 1745 </data> 1746 <data name="toolStripMenuItem1.Size" type="System.Drawing.Size, System.Drawing"> 1747 <value>189, 6</value> 1748 </data> 1749 <data name="hideWhenMinimisedToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing"> 1750 <value>192, 22</value> 1751 </data> 1752 <data name="hideWhenMinimisedToolStripMenuItem.Text" xml:space="preserve"> 1753 <value>Hide When Minimised</value> 1754 </data> 1755 <data name="exitToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing"> 1756 <value>192, 22</value> 1757 </data> 1758 <data name="exitToolStripMenuItem.Text" xml:space="preserve"> 1759 <value>E&xit Eraser</value> 1760 </data> 1761 1761 <metadata name="notificationIconTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 1762 1762 <value>634, 17</value> … … 1768 1768 <value>None</value> 1769 1769 </data> 1770 <data name="ToolBar.Location" type="System.Drawing.Point, System.Drawing"> 1771 <value>10, 27</value> 1772 </data> 1773 <data name="ToolBar.Size" type="System.Drawing.Size, System.Drawing"> 1774 <value>392, 32</value> 1775 </data> 1776 <data name="ToolBar.TabIndex" type="System.Int32, mscorlib"> 1777 <value>1</value> 1778 </data> 1779 <data name="ToolBar.Text" xml:space="preserve"> 1780 <value>ToolBar</value> 1781 </data> 1782 <data name=">>ToolBar.Name" xml:space="preserve"> 1783 <value>ToolBar</value> 1784 </data> 1785 <data name=">>ToolBar.Type" xml:space="preserve"> 1786 <value>Eraser.ToolBar, Eraser, Version=6.1.0.2532, Culture=neutral, PublicKeyToken=3ac89a0351e689b6</value> 1787 </data> 1788 <data name=">>ToolBar.Parent" xml:space="preserve"> 1789 <value>$this</value> 1790 </data> 1791 <data name=">>ToolBar.ZOrder" xml:space="preserve"> 1792 <value>6</value> 1793 </data> 1770 1794 <metadata name="tbScheduleMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 1771 1795 <value>110, 17</value> 1772 1796 </metadata> 1797 <data name="newTaskToolStripMenuItem.ShortcutKeys" type="System.Windows.Forms.Keys, System.Windows.Forms"> 1798 <value>Ctrl+N</value> 1799 </data> 1800 <data name="newTaskToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing"> 1801 <value>168, 22</value> 1802 </data> 1803 <data name="newTaskToolStripMenuItem.Text" xml:space="preserve"> 1804 <value>New Task</value> 1805 </data> 1806 <data name="toolStripMenuItem2.Size" type="System.Drawing.Size, System.Drawing"> 1807 <value>165, 6</value> 1808 </data> 1809 <data name="exportTaskListToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing"> 1810 <value>168, 22</value> 1811 </data> 1812 <data name="exportTaskListToolStripMenuItem.Text" xml:space="preserve"> 1813 <value>Export Task List</value> 1814 </data> 1815 <data name="importTaskListToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing"> 1816 <value>168, 22</value> 1817 </data> 1818 <data name="importTaskListToolStripMenuItem.Text" xml:space="preserve"> 1819 <value>Import Task List</value> 1820 </data> 1773 1821 <data name="tbScheduleMenu.Size" type="System.Drawing.Size, System.Drawing"> 1774 1822 <value>169, 76</value> … … 1869 1917 <data name="tbHelpDropDown.Text" xml:space="preserve"> 1870 1918 <value>Help</value> 1871 </data>1872 <data name="ToolBar.Location" type="System.Drawing.Point, System.Drawing">1873 <value>10, 27</value>1874 </data>1875 <data name="ToolBar.Size" type="System.Drawing.Size, System.Drawing">1876 <value>392, 32</value>1877 </data>1878 <data name="ToolBar.TabIndex" type="System.Int32, mscorlib">1879 <value>1</value>1880 </data>1881 <data name="ToolBar.Text" xml:space="preserve">1882 <value>ToolBar</value>1883 </data>1884 <data name=">>ToolBar.Name" xml:space="preserve">1885 <value>ToolBar</value>1886 </data>1887 <data name=">>ToolBar.Type" xml:space="preserve">1888 <value>Eraser.ToolBar, Eraser, Version=6.1.0.2112, Culture=neutral, PublicKeyToken=ab8c5acb8db9a36b</value>1889 </data>1890 <data name=">>ToolBar.Parent" xml:space="preserve">1891 <value>$this</value>1892 </data>1893 <data name=">>ToolBar.ZOrder" xml:space="preserve">1894 <value>6</value>1895 </data>1896 <data name="newTaskToolStripMenuItem.ShortcutKeys" type="System.Windows.Forms.Keys, System.Windows.Forms">1897 <value>Ctrl+N</value>1898 </data>1899 <data name="newTaskToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">1900 <value>168, 22</value>1901 </data>1902 <data name="newTaskToolStripMenuItem.Text" xml:space="preserve">1903 <value>New Task</value>1904 </data>1905 <data name="toolStripMenuItem2.Size" type="System.Drawing.Size, System.Drawing">1906 <value>165, 6</value>1907 </data>1908 <data name="exportTaskListToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">1909 <value>168, 22</value>1910 </data>1911 <data name="exportTaskListToolStripMenuItem.Text" xml:space="preserve">1912 <value>Export Task List</value>1913 </data>1914 <data name="importTaskListToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">1915 <value>168, 22</value>1916 </data>1917 <data name="importTaskListToolStripMenuItem.Text" xml:space="preserve">1918 <value>Import Task List</value>1919 1919 </data> 1920 1920 <data name="checkForUpdatesToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing"> -
branches/eraser6/EraserService/Eraser/Program.ConsoleProgram.cs
r2516 r2737 100 100 public void Run() 101 101 { 102 //Check that we've got an action corresponding to one the user requested. 103 if (!Handlers.ContainsKey(Arguments.Action)) 104 throw new ArgumentException(S._("Unknown action {0}", Arguments.Action)); 105 102 106 //Re-parse the command line arguments as arguments for the given action. 103 107 ConsoleActionData data = Handlers[Arguments.Action]; -
branches/eraser6/EraserService/Eraser/Program.GuiProgram.cs
r2538 r2737 57 57 58 58 //Check if there already is another instance of the program. 59 bool isFirstInstance = false; 60 GlobalMutex = new Mutex(true, instanceID, out isFirstInstance); 61 IsFirstInstance = isFirstInstance; 59 try 60 { 61 bool isFirstInstance = false; 62 GlobalMutex = new Mutex(true, instanceID, out isFirstInstance); 63 IsFirstInstance = isFirstInstance; 64 } 65 catch (UnauthorizedAccessException) 66 { 67 //If we get here, the mutex exists but we cannot modify it. That 68 //would imply that this is not the first instance. 69 //See http://msdn.microsoft.com/en-us/library/bwe34f1k.aspx 70 IsFirstInstance = false; 71 } 62 72 } 63 73 -
branches/eraser6/EraserService/Eraser/Program.cs
r2735 r2737 325 325 new ConsoleActionData(CommandHelp, new ConsoleArguments())); 326 326 program.Handlers.Add("erase", 327 new ConsoleActionData(CommandErase, new EraseArguments())); 327 new ConsoleActionData(CommandErase, new EraseArguments())); 328 328 program.Handlers.Add("addtask", 329 329 new ConsoleActionData(CommandAddTask, new TaskArguments())); … … 343 343 Console.WriteLine(e.Message); 344 344 return e.ErrorCode; 345 } 346 catch (ArgumentException e) 347 { 348 Console.WriteLine(e.Message); 349 return Win32ErrorCode.BadArguments; 345 350 } 346 351 catch (Exception e) -
branches/eraser6/EraserService/Eraser/Strings.en.resx
r2609 r2737 154 154 <value>Processing:</value> 155 155 </data> 156 <data name="Unknown action {0}" xml:space="preserve"> 157 <value>Unknown action {0}</value> 158 </data> 156 159 <data name="Eraser cannot connect to the running instance for erasures." xml:space="preserve"> 157 160 <value>Eraser cannot connect to the running instance for erasures.</value> … … 296 299 </data> 297 300 <data name="Default drive erasure method" xml:space="preserve"> 298 <value> (Untranslated)</value>301 <value>Default drive erasure method</value> 299 302 </data> 300 303 <data name="Randomness data source" xml:space="preserve"> … … 317 320 </data> 318 321 <data name="An invalid drive erasure method was selected." xml:space="preserve"> 319 <value> (Untranslated)</value>322 <value>An invalid drive erasure method was selected.</value> 320 323 </data> 321 324 <data name="An invalid randomness data source was selected." xml:space="preserve"> … … 335 338 </data> 336 339 <data name="The erasure method selected does not support erasing the erasure target." xml:space="preserve"> 337 <value> (Untranslated)</value>340 <value>The erasure method selected does not support erasing the erasure target.</value> 338 341 </data> 339 342 <data name="{0}, " xml:space="preserve"> … … 397 400 <value>{0} of {1} downloaded</value> 398 401 </data> 402 <data name="Installation failed with exit code {0}" xml:space="preserve"> 403 <value>Installation failed with exit code {0}</value> 404 </data> 405 <data name="Installation cancelled" xml:space="preserve"> 406 <value>Installation cancelled</value> 407 </data> 399 408 </root> -
branches/eraser6/EraserService/Eraser/Strings.it.resx
r2609 r2737 154 154 <value>Elaborazione:</value> 155 155 </data> 156 <data name="Unknown action {0}" xml:space="preserve"> 157 <value>(Untranslated)</value> 158 </data> 156 159 <data name="Eraser cannot connect to the running instance for erasures." xml:space="preserve"> 157 160 <value>Eraser non riesce a collegarsi alla istanza di pulizia in esecuzione.</value> … … 397 400 <value>scaricato {0} di {1}</value> 398 401 </data> 402 <data name="Installation failed with exit code {0}" xml:space="preserve"> 403 <value>(Untranslated)</value> 404 </data> 405 <data name="Installation cancelled" xml:space="preserve"> 406 <value>(Untranslated)</value> 407 </data> 399 408 </root> -
branches/eraser6/EraserService/Eraser/Strings.nl.resx
r2609 r2737 154 154 <value>(Untranslated)</value> 155 155 </data> 156 <data name="Unknown action {0}" xml:space="preserve"> 157 <value>(Untranslated)</value> 158 </data> 156 159 <data name="Eraser cannot connect to the running instance for erasures." xml:space="preserve"> 157 160 <value>(Untranslated)</value> … … 397 400 <value>(Untranslated)</value> 398 401 </data> 402 <data name="Installation failed with exit code {0}" xml:space="preserve"> 403 <value>(Untranslated)</value> 404 </data> 405 <data name="Installation cancelled" xml:space="preserve"> 406 <value>(Untranslated)</value> 407 </data> 399 408 </root> -
branches/eraser6/EraserService/Eraser/Strings.pl.resx
r2609 r2737 154 154 <value>Przetwarzanie:</value> 155 155 </data> 156 <data name="Unknown action {0}" xml:space="preserve"> 157 <value>(Untranslated)</value> 158 </data> 156 159 <data name="Eraser cannot connect to the running instance for erasures." xml:space="preserve"> 157 160 <value>(Untranslated)</value> … … 397 400 <value>pobrano {0} z {1}</value> 398 401 </data> 402 <data name="Installation failed with exit code {0}" xml:space="preserve"> 403 <value>(Untranslated)</value> 404 </data> 405 <data name="Installation cancelled" xml:space="preserve"> 406 <value>(Untranslated)</value> 407 </data> 399 408 </root> -
branches/eraser6/EraserService/Eraser/Strings.resx
r2609 r2737 154 154 <value>Processing:</value> 155 155 </data> 156 <data name="Unknown action {0}" xml:space="preserve"> 157 <value>Unknown action {0}</value> 158 </data> 156 159 <data name="Eraser cannot connect to the running instance for erasures." xml:space="preserve"> 157 160 <value>Eraser cannot connect to the running instance for erasures.</value> … … 397 400 <value>{0} of {1} downloaded</value> 398 401 </data> 402 <data name="Installation failed with exit code {0}" xml:space="preserve"> 403 <value>Installation failed with exit code {0}</value> 404 </data> 405 <data name="Installation cancelled" xml:space="preserve"> 406 <value>Installation cancelled</value> 407 </data> 399 408 </root> -
branches/eraser6/EraserService/Eraser/UpdateForm.cs
r2516 r2737 34 34 using System.Net.Mime; 35 35 using System.Globalization; 36 using System.ComponentModel; 36 37 37 38 using Eraser.Util; … … 39 40 40 41 using DoWorkEventArgs = System.ComponentModel.DoWorkEventArgs; 42 using ProgressChangedEventArgs = Eraser.Plugins.ProgressChangedEventArgs; 41 43 using ProgressChangedEventHandler = Eraser.Plugins.ProgressChangedEventHandler; 42 44 using RunWorkerCompletedEventArgs = System.ComponentModel.RunWorkerCompletedEventArgs; … … 715 717 try 716 718 { 717 //Request the download. 718 HttpWebRequest request = (HttpWebRequest)WebRequest.Create(Link); 719 using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) 720 { 721 //Do the progress calculations 722 progress.Total = response.ContentLength; 723 724 //Check for a suggested filename. 725 ContentDisposition contentDisposition = null; 726 foreach (string header in response.Headers.AllKeys) 727 if (header.ToUpperInvariant() == "CONTENT-DISPOSITION") 728 contentDisposition = new ContentDisposition(response.Headers[header]); 729 730 //Create the file name. 731 DownloadedFile = new FileInfo(Path.Combine( 732 TempPath.FullName, string.Format(CultureInfo.InvariantCulture, 733 "{0:00}-{1}", ++DownloadFileIndex, contentDisposition == null ? 734 Path.GetFileName(Link.GetComponents(UriComponents.Path, UriFormat.Unescaped)) : 735 contentDisposition.FileName))); 736 737 using (Stream responseStream = response.GetResponseStream()) 738 using (FileStream fileStream = DownloadedFile.OpenWrite()) 719 Uri downloadLink = Link; 720 ContentDisposition contentDisposition = null; 721 for (int redirects = 0; redirects < 20; ++redirects) 722 { 723 //Request the download. 724 HttpWebRequest request = (HttpWebRequest)WebRequest.Create(downloadLink); 725 request.AllowAutoRedirect = false; 726 using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) 739 727 { 740 //Copy the information into the file stream 741 int lastRead = 0; 742 byte[] buffer = new byte[16384]; 743 while ((lastRead = responseStream.Read(buffer, 0, buffer.Length)) != 0) 728 //Check for a suggested filename. Store this until we get the final URI. 729 foreach (string header in response.Headers.AllKeys) 730 if (header.ToUpperInvariant() == "CONTENT-DISPOSITION") 731 contentDisposition = new ContentDisposition(response.Headers[header]); 732 733 //Handle 3xx series response codes. 734 if ((int)response.StatusCode >= 300 && (int)response.StatusCode <= 399) 744 735 { 745 fileStream.Write(buffer, 0, lastRead); 746 747 //Compute progress 748 progress.Completed = fileStream.Position; 749 750 //Call the progress handler 751 if (handler != null) 752 handler(this, new ProgressChangedEventArgs(progress, null)); 736 //Redirect. 737 bool locationHeader = false; 738 foreach (string header in response.Headers.AllKeys) 739 if (header.ToUpperInvariant() == "LOCATION") 740 { 741 locationHeader = true; 742 downloadLink = new Uri(response.Headers[header]); 743 break; 744 } 745 746 if (!locationHeader) 747 throw new WebException("A redirect response was received but no redirection" + 748 "URI was provided."); 749 750 continue; 753 751 } 752 753 //Do the progress calculations 754 progress.Total = response.ContentLength; 755 756 //Create the file name. 757 DownloadedFile = new FileInfo(Path.Combine( 758 TempPath.FullName, string.Format(CultureInfo.InvariantCulture, 759 "{0:00}-{1}", ++DownloadFileIndex, contentDisposition == null ? 760 Path.GetFileName(downloadLink.GetComponents(UriComponents.Path, UriFormat.Unescaped)) : 761 contentDisposition.FileName))); 762 763 using (Stream responseStream = response.GetResponseStream()) 764 using (FileStream fileStream = DownloadedFile.OpenWrite()) 765 { 766 //Copy the information into the file stream 767 int lastRead = 0; 768 byte[] buffer = new byte[16384]; 769 while ((lastRead = responseStream.Read(buffer, 0, buffer.Length)) != 0) 770 { 771 fileStream.Write(buffer, 0, lastRead); 772 773 //Compute progress 774 progress.Completed = fileStream.Position; 775 776 //Call the progress handler 777 if (handler != null) 778 handler(this, new ProgressChangedEventArgs(progress, null)); 779 } 780 } 781 782 //Let the event handler know the download is complete. 783 progress.MarkComplete(); 784 if (handler != null) 785 handler(this, new ProgressChangedEventArgs(progress, null)); 786 return; 754 787 } 755 788 756 //Let the event handler know the download is complete. 757 progress.MarkComplete(); 758 if (handler != null) 759 handler(this, new ProgressChangedEventArgs(progress, null)); 789 throw new WebException("The server is not redirecting properly."); 760 790 } 761 791 } … … 781 811 info.UseShellExecute = true; 782 812 783 Process process = Process.Start(info); 784 process.WaitForExit(Int32.MaxValue); 813 try 814 { 815 Process process = Process.Start(info); 816 process.WaitForExit(Int32.MaxValue); 817 818 if (process.ExitCode != 0) 819 throw new ApplicationException(S._("Installation failed with exit code {0}", 820 process.ExitCode)); 821 } 822 catch (Win32Exception e) 823 { 824 if (e.ErrorCode != 1223) 825 throw; 826 827 throw new OperationCanceledException(S._("Installation cancelled"), e); 828 } 829 785 830 } 786 831
Note: See TracChangeset
for help on using the changeset viewer.
