[tasque/viewmodel: 16/78] Add Backend.DeleteTask method



commit c1a534232e2686736c76107ed8d7d7a5ddcfb0f3
Author: Antonius Riha <antoniusriha gmail com>
Date:   Thu Jul 26 20:32:30 2012 +0200

    Add Backend.DeleteTask method

 src/libtasque/Backend.cs |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/src/libtasque/Backend.cs b/src/libtasque/Backend.cs
index 8ba6e2e..270c9e4 100644
--- a/src/libtasque/Backend.cs
+++ b/src/libtasque/Backend.cs
@@ -138,7 +138,7 @@ namespace Tasque
 			bool isEmpty = true;
 			foreach (var cat in categories) {
 				if (cat == null)
-					throw new ArgumentException ("One of the provided categories is null.","categories");
+					throw new ArgumentException ("One of the provided categories is null.", "categories");
 
 				cat.Add (task);
 				isEmpty = false;
@@ -150,6 +150,15 @@ namespace Tasque
 
 			return task;
 		}
+		
+		public void DeleteTask (Task task)
+		{
+			if (task == null)
+				throw new ArgumentNullException ("task");
+			
+			foreach (var cat in Categories)
+				cat.Remove (task);
+		}
 
 		/// <summary>
 		/// Initializes the backend



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]