[tasque/transition: 191/213] [RTM] Implement abstract CreateTaskCore method on backend



commit 2db5f8d11e874630dab1d0e4535039cd5fdd57f4
Author: Antonius Riha <antoniusriha gmail com>
Date:   Sun Aug 19 10:59:31 2012 +0200

    [RTM] Implement abstract CreateTaskCore method on backend

 src/Addins/RtmBackend/RtmBackend.cs |   22 +++++++---------------
 1 files changed, 7 insertions(+), 15 deletions(-)
---
diff --git a/src/Addins/RtmBackend/RtmBackend.cs b/src/Addins/RtmBackend/RtmBackend.cs
index 65f6b74..c8aa8c5 100644
--- a/src/Addins/RtmBackend/RtmBackend.cs
+++ b/src/Addins/RtmBackend/RtmBackend.cs
@@ -57,26 +57,18 @@ namespace Tasque.Backends.RtmBackend
 		}
 
 		#region Public Methods
-		public Task CreateTask (string taskName, Category category)
+		protected override Task CreateTaskCore (string taskName, IEnumerable<Category> categories)
 		{
-			string categoryID;
+			var category = categories.ElementAt (0);
+			var categoryID = (category as RtmCategory).ID;
 			RtmTask rtmTask = null;
-			
-			if (category is Tasque.AllCategory)
-				categoryID = null;
-			else
-				categoryID = (category as RtmCategory).ID;	
 
 			if (rtm != null) {
 				try {
-					List list;
-					
-					if (categoryID == null)
-						list = rtm.TasksAdd (timeline, taskName);
-					else
-						list = rtm.TasksAdd (timeline, taskName, categoryID);
-
-					rtmTask = UpdateTaskFromResult (list);
+					var list = rtm.TasksAdd (timeline, taskName, categoryID);
+					var ts = list.TaskSeriesCollection [0];
+					if (ts != null)
+						rtmTask = new RtmTask (ts, this, list.ID);
 				} catch (Exception e) {
 					Debug.WriteLine ("Unable to set create task: " + taskName);
 					Debug.WriteLine (e.ToString ());



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