Index: Core/Common/src/Core.Common.Base/IObservable.cs
===================================================================
diff -u -r2a90c0c1be6114f72af65c42f0a6f334b30e4755 -re823dc6f52bf6a01f421c69b95a07e6258ec33de
--- Core/Common/src/Core.Common.Base/IObservable.cs (.../IObservable.cs) (revision 2a90c0c1be6114f72af65c42f0a6f334b30e4755)
+++ Core/Common/src/Core.Common.Base/IObservable.cs (.../IObservable.cs) (revision e823dc6f52bf6a01f421c69b95a07e6258ec33de)
@@ -1,27 +1,26 @@
namespace Core.Common.Base
{
///
- /// This interface describes the methods that need to be implemented on a class of objects that are supposed to be observable.
- /// Being observable let classes notify observers that they have performed an action (for example changed data).
+ /// Interface that describes the methods that need to be implemented on classes that are supposed to be observable.
+ /// Observables should (asynchronously) notify their observers of the fact that their internal state has changed.
+ ///
///
public interface IObservable
{
///
- /// Attach an to this . Changes in the will notify the
- /// .
+ /// This method attaches . As a result, changes in the will now be notified to .
///
/// The to notify on changes.
void Attach(IObserver observer);
///
- /// Detach an from this . Changes in the will no longer
- /// notify the .
+ /// This method dettaches . As a result, changes in the will no longer be notified to .
///
/// The to no longer notify on changes.
void Detach(IObserver observer);
///
- /// Notifies all the observers that have been currently attached to this .
+ /// This method notifies all observers that have been currently attached to the .
///
void NotifyObservers();
}
Index: Core/Common/src/Core.Common.Base/IObserver.cs
===================================================================
diff -u -r2a90c0c1be6114f72af65c42f0a6f334b30e4755 -re823dc6f52bf6a01f421c69b95a07e6258ec33de
--- Core/Common/src/Core.Common.Base/IObserver.cs (.../IObserver.cs) (revision 2a90c0c1be6114f72af65c42f0a6f334b30e4755)
+++ Core/Common/src/Core.Common.Base/IObserver.cs (.../IObserver.cs) (revision e823dc6f52bf6a01f421c69b95a07e6258ec33de)
@@ -1,7 +1,14 @@
namespace Core.Common.Base
{
+ ///
+ /// Interface that describes the methods that need to be implemented on classes that are supposed to be observer.
+ ///
+ ///
public interface IObserver
{
+ ///
+ /// This method performs an update of the , triggered by a notification of an .
+ ///
void UpdateObserver();
}
}
\ No newline at end of file
Index: Core/Common/src/Core.Common.Base/Observable.cs
===================================================================
diff -u -r94ef875f26bff005b1d53880c92f350b373a31ec -re823dc6f52bf6a01f421c69b95a07e6258ec33de
--- Core/Common/src/Core.Common.Base/Observable.cs (.../Observable.cs) (revision 94ef875f26bff005b1d53880c92f350b373a31ec)
+++ Core/Common/src/Core.Common.Base/Observable.cs (.../Observable.cs) (revision e823dc6f52bf6a01f421c69b95a07e6258ec33de)
@@ -4,36 +4,22 @@
namespace Core.Common.Base
{
///
- /// Own implementation of the Observable pattern that cooperates with Observers (own IObserver interface).
- /// In places where multiple inheritance is not possible, use IObservable instead.
+ /// Class that implements the pattern.
///
public abstract class Observable : IObservable
{
private readonly IList observers = new List();
- ///
- /// Attach an to this . Changes in the will notify the
- /// .
- ///
- /// The to notify on changes.
public void Attach(IObserver observer)
{
observers.Add(observer);
}
- ///
- /// Detach an from this . Changes in the will no longer
- /// notify the .
- ///
- /// The to no longer notify on changes.
public void Detach(IObserver observer)
{
observers.Remove(observer);
}
- ///
- /// Notifies all the observers that have been currently attached to this .
- ///
public void NotifyObservers()
{
// Iterate through a copy of the list of observers; an update of one observer might result in detaching another observer (which will result in a "list modified" exception over here otherwise)
Index: Core/Common/src/Core.Common.Base/ObservableList.cs
===================================================================
diff -u -r7bcd564343094615f52e49178f27f7bfe22cebc8 -re823dc6f52bf6a01f421c69b95a07e6258ec33de
--- Core/Common/src/Core.Common.Base/ObservableList.cs (.../ObservableList.cs) (revision 7bcd564343094615f52e49178f27f7bfe22cebc8)
+++ Core/Common/src/Core.Common.Base/ObservableList.cs (.../ObservableList.cs) (revision e823dc6f52bf6a01f421c69b95a07e6258ec33de)
@@ -4,7 +4,7 @@
namespace Core.Common.Base
{
///
- /// Extends the class with implementation for .
+ /// Class that extends the class with an implementation of .
///
/// The type of elements in the list.
public class ObservableList : List, IObservable
Index: Core/Common/src/Core.Common.Base/Service/FileImportActivity.cs
===================================================================
diff -u -r358f5af627a563dd5b6903b94ba6abb16df8084e -re823dc6f52bf6a01f421c69b95a07e6258ec33de
--- Core/Common/src/Core.Common.Base/Service/FileImportActivity.cs (.../FileImportActivity.cs) (revision 358f5af627a563dd5b6903b94ba6abb16df8084e)
+++ Core/Common/src/Core.Common.Base/Service/FileImportActivity.cs (.../FileImportActivity.cs) (revision e823dc6f52bf6a01f421c69b95a07e6258ec33de)
@@ -1,20 +1,31 @@
using System;
+using System.Linq;
using Core.Common.Base.IO;
using Core.Common.Base.Properties;
namespace Core.Common.Base.Service
{
+ ///
+ /// for importing the data in one or more files (in the same thread).
+ ///
public class FileImportActivity : Activity
{
private readonly object target;
+ private readonly string[] filePaths;
private readonly IFileImporter importer;
- private readonly string[] files;
+
private bool shouldCancel;
///
- /// One Activity (thread) for a serial file import.
+ /// Constructs a new .
///
- public FileImportActivity(IFileImporter importer, object target, string[] files)
+ /// The to use for importing the data.
+ /// The target object to import the data to.
+ /// The paths of the files to import the data from.
+ /// Thrown when is null.
+ /// Thrown when is null.
+ /// Thrown when is null or contains no file paths.
+ public FileImportActivity(IFileImporter importer, object target, string[] filePaths)
{
if (importer == null)
{
@@ -26,14 +37,14 @@
throw new ArgumentException("target");
}
- if (files == null)
+ if (filePaths == null || !filePaths.Any())
{
throw new ArgumentException("files");
}
this.importer = importer;
this.target = target;
- this.files = files;
+ this.filePaths = filePaths;
}
public override string Name
@@ -46,7 +57,7 @@
protected override void OnRun()
{
- foreach (var fileName in files)
+ foreach (var fileName in filePaths)
{
ImportFromFile(fileName);