Renamed FailableOperation to Request, this is a much shorter name that better represents the concept implemented by the class

git-svn-id: file:///srv/devel/repo-conversion/nusu@62 d2e56fa2-650e-0410-a79f-9358c0239efd
This commit is contained in:
Markus Ewald 2008-03-26 19:52:28 +00:00
parent 533cbba3c5
commit c21ba759cc
4 changed files with 47 additions and 27 deletions

View file

@ -48,6 +48,7 @@ namespace Nuclex.Support.Tracking {
) {
this.weightedProgression = weightedProgression;
// See if this progression has already ended (initial check for performance)
if(weightedProgression.Progression.Ended) {
this.progress = 1.0f;
@ -60,8 +61,17 @@ namespace Nuclex.Support.Tracking {
this.weightedProgression.Progression.AsyncEnded +=
new EventHandler(asyncEnded);
this.weightedProgression.Progression.AsyncProgressUpdated +=
new EventHandler<ProgressUpdateEventArgs>(asyncProgressUpdated);
// Check whether this progression might have ended before we were able to
// attach ourselfes to its event. If so, don't bother registering to the
// other event and (important) set our progress to 1.0 because, since we
// might not have gotten the 'Ended' event, it might otherwise stay at 0.0
// even though the progression is in the 'Ended' state.
if(weightedProgression.Progression.Ended) {
this.progress = 1.0f;
} else {
this.weightedProgression.Progression.AsyncProgressUpdated +=
new EventHandler<ProgressUpdateEventArgs>(asyncProgressUpdated);
}
}
}