diff --git a/Nuclex.Support (PC).csproj b/Nuclex.Support (PC).csproj index 60cf710..d710962 100644 --- a/Nuclex.Support (PC).csproj +++ b/Nuclex.Support (PC).csproj @@ -241,6 +241,10 @@ false ObservedWeightedProgression + + false + IStatusReporter + false ProgressionTracker @@ -275,6 +279,10 @@ SetProgression.Test SetProgression.cs + + false + StatusReportEventArgs + false WeightedProgression diff --git a/Source/Packing/CygonRectanglePacker.cs b/Source/Packing/CygonRectanglePacker.cs index b9817d4..2e7ff87 100644 --- a/Source/Packing/CygonRectanglePacker.cs +++ b/Source/Packing/CygonRectanglePacker.cs @@ -28,14 +28,14 @@ namespace Nuclex.Support.Packing { /// Packer using a custom algorithm by Markus 'Cygon' Ewald /// /// - /// Algorithm conceived by Markus Ewald (cygon at nuclex dot org), thought + /// Algorithm conceived by Markus Ewald (cygon at nuclex dot org), though /// I'm quite sure I'm not the first one to come up with it :) /// /// /// The algorithm always places rectangles as low as possible in the packing - /// area. So, for any new rectangle that is to be added into the packing area, - /// the packer has to determine the X coordinate at which the rectangle can have - /// the lowest overall height without intersecting any other rectangles. + /// area. So, for any new rectangle that is to be added, the packer has to + /// determine the X coordinate at which the rectangle can have the lowest + /// overall height without intersecting any other rectangles. /// /// /// To quickly discover these locations, the packer uses a sophisticated diff --git a/Source/Tracking/IStatusReporter.cs b/Source/Tracking/IStatusReporter.cs new file mode 100644 index 0000000..6c00741 --- /dev/null +++ b/Source/Tracking/IStatusReporter.cs @@ -0,0 +1,34 @@ +#region CPL License +/* +Nuclex Framework +Copyright (C) 2002-2007 Nuclex Development Labs + +This library is free software; you can redistribute it and/or +modify it under the terms of the IBM Common Public License as +published by the IBM Corporation; either version 1.0 of the +License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +IBM Common Public License for more details. + +You should have received a copy of the IBM Common Public +License along with this library +*/ +#endregion + +using System; +using System.Collections.Generic; + +namespace Nuclex.Support.Tracking { + + /// Interface for processes that report their status + interface IStatusReporter { + + /// Triggered when the status of the process changes + event EventHandler StatusChanged; + + } + +} // namespace Nuclex.Support.Tracking diff --git a/Source/Tracking/Progression.cs b/Source/Tracking/Progression.cs index f104b32..526b34f 100644 --- a/Source/Tracking/Progression.cs +++ b/Source/Tracking/Progression.cs @@ -86,7 +86,7 @@ namespace Nuclex.Support.Tracking { // // We can *not* optimize this lock away since we absolutely must not create // two doneEvents -- someone might call .WaitOne() on the first one when only - // the second one is assigned to this.doneEvent and thus gets set in the end. + // the second one is references by this.doneEvent and thus gets set in the end. if(this.doneEvent == null) { lock(this) { diff --git a/Source/Tracking/StatusReportEventArgs.cs b/Source/Tracking/StatusReportEventArgs.cs new file mode 100644 index 0000000..d571f23 --- /dev/null +++ b/Source/Tracking/StatusReportEventArgs.cs @@ -0,0 +1,51 @@ +#region CPL License +/* +Nuclex Framework +Copyright (C) 2002-2007 Nuclex Development Labs + +This library is free software; you can redistribute it and/or +modify it under the terms of the IBM Common Public License as +published by the IBM Corporation; either version 1.0 of the +License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +IBM Common Public License for more details. + +You should have received a copy of the IBM Common Public +License along with this library +*/ +#endregion + +using System; +using System.Collections.Generic; + +namespace Nuclex.Support.Tracking { + + /// Event arguments for reporting a status to the subscriber + public class StatusReportEventArgs : EventArgs { + + /// Initializes a new status report event arguments container + /// Status to report to the event's subscribers + public StatusReportEventArgs(string status) { + this.status = status; + } + + /// The currently reported status + /// + /// The contents of this string are up to the publisher of the event to + /// define. Though it is recommended to report the status as a human-readable + /// string, these strings might not in all cases be properly localized or + /// suitable for display in a GUI. + /// + public string Status { + get { return this.status; } + } + + /// Reported status + private string status; + + } + +} // namespace Nuclex.Support.Tracking