[tasque] Remove obsolete classes



commit aa5b2e42da845af7acc960b3e603f30342e7bfe4
Author: Antonius Riha <antoniusriha gmail com>
Date:   Fri May 17 16:42:05 2013 +0200

    Remove obsolete classes

 src/Addins/Backends/Dummy/DummyBackend.cs          |    2 +-
 src/Addins/Backends/Rtm/RtmBackend.cs              |    2 +-
 src/Addins/Backends/Sqlite/SqliteBackend.cs        |   18 +-
 .../InternalBackendManager.TaskListCollection.cs   |    4 +-
 src/libtasque/Core/Impl/InternalBackendManager.cs  |    6 +-
 .../Data/BackendInitializationException.cs         |   68 ---------
 src/libtasque/Data/IBackend.cs                     |  154 ++++++++++----------
 src/libtasque/Data/IBackend2.cs                    |   94 ------------
 src/libtasque/Data/TransactionException.cs         |   67 ---------
 src/libtasque/libtasque.csproj                     |    7 +-
 10 files changed, 92 insertions(+), 330 deletions(-)
---
diff --git a/src/Addins/Backends/Dummy/DummyBackend.cs b/src/Addins/Backends/Dummy/DummyBackend.cs
index 09cdf77..e4ed495 100644
--- a/src/Addins/Backends/Dummy/DummyBackend.cs
+++ b/src/Addins/Backends/Dummy/DummyBackend.cs
@@ -32,7 +32,7 @@ using Gtk.Tasque.Backends.Dummy;
 namespace Tasque.Backends.Dummy
 {
        [BackendExtension ("Dummy")]
-       public class DummyBackend : IBackend2
+       public class DummyBackend : IBackend
        {
                public DummyBackend ()
                {
diff --git a/src/Addins/Backends/Rtm/RtmBackend.cs b/src/Addins/Backends/Rtm/RtmBackend.cs
index 0a5d27d..3e9004c 100644
--- a/src/Addins/Backends/Rtm/RtmBackend.cs
+++ b/src/Addins/Backends/Rtm/RtmBackend.cs
@@ -31,7 +31,7 @@ using Tasque.Utils;
 namespace Tasque.Backends.Rtm
 {
        [BackendExtension ("Remember the Milk")]
-       public class RtmBackend : IBackend2
+       public class RtmBackend : IBackend
        {
                public bool IsConfigured { get; private set; }
 
diff --git a/src/Addins/Backends/Sqlite/SqliteBackend.cs b/src/Addins/Backends/Sqlite/SqliteBackend.cs
index 900ffad..7fc1067 100644
--- a/src/Addins/Backends/Sqlite/SqliteBackend.cs
+++ b/src/Addins/Backends/Sqlite/SqliteBackend.cs
@@ -32,7 +32,7 @@ using Tasque.Utils;
 namespace Tasque.Data.Sqlite
 {
        [BackendExtension ("Local file")]
-       public class SqliteBackend : IBackend2
+       public class SqliteBackend : IBackend
        {
                public TasqueObjectFactory Factory { get; private set; }
 
@@ -40,9 +40,9 @@ namespace Tasque.Data.Sqlite
 
                public event EventHandler Initialized, Disposed;
 
-               bool IBackend2.IsConfigured { get { return IsInitialized; } }
+               bool IBackend.IsConfigured { get { return IsInitialized; } }
 
-               IBackendPreferences IBackend2.Preferences {
+               IBackendPreferences IBackend.Preferences {
                        get { return new SqlitePreferences (); }
                }
                
@@ -58,7 +58,7 @@ namespace Tasque.Data.Sqlite
                        get { return taskRepo; }
                }
                
-               void IBackend2.Initialize (IPreferences preferences)
+               void IBackend.Initialize (IPreferences preferences)
                {
                        if (preferences == null)
                                throw new ArgumentNullException ("preferences");
@@ -92,7 +92,7 @@ namespace Tasque.Data.Sqlite
                                Disposed (this, EventArgs.Empty);
                }
                
-               IEnumerable<ITaskListCore> IBackend2.GetAll ()
+               IEnumerable<ITaskListCore> IBackend.GetAll ()
                {
                        yield return allList;
 
@@ -137,22 +137,22 @@ namespace Tasque.Data.Sqlite
                        }
                }
                
-               ITaskListCore IBackend2.GetBy (string id)
+               ITaskListCore IBackend.GetBy (string id)
                {
                        throw new NotImplementedException ();
                }
                
-               void IBackend2.Create (ITaskListCore taskList)
+               void IBackend.Create (ITaskListCore taskList)
                {
                        throw new NotImplementedException ();
                }
                
-               void IBackend2.Delete (ITaskListCore taskList)
+               void IBackend.Delete (ITaskListCore taskList)
                {
                        throw new NotImplementedException ();
                }
                
-               event EventHandler IBackend2.NeedsConfiguration { add {} remove {} }
+               event EventHandler IBackend.NeedsConfiguration { add {} remove {} }
 
                ITaskListCore CreateInitialTaskList (string listName)
                {
diff --git a/src/libtasque/Core/Impl/InternalBackendManager.TaskListCollection.cs 
b/src/libtasque/Core/Impl/InternalBackendManager.TaskListCollection.cs
index 1bb0383..578f2cf 100644
--- a/src/libtasque/Core/Impl/InternalBackendManager.TaskListCollection.cs
+++ b/src/libtasque/Core/Impl/InternalBackendManager.TaskListCollection.cs
@@ -47,7 +47,7 @@ namespace Tasque.Core.Impl
 
                        public ReadOnlyObservableCollection<ITask> Tasks { get; private set; }
 
-                       public void LoadTaskLists (IBackend2 backend)
+                       public void LoadTaskLists (IBackend backend)
                        {
                                if (backend == null)
                                        throw new ArgumentNullException ("backend");
@@ -198,7 +198,7 @@ namespace Tasque.Core.Impl
                        }
                        
                        ObservableCollection<ITask> tasks;
-                       IBackend2 backend;
+                       IBackend backend;
                }
        }
 }
diff --git a/src/libtasque/Core/Impl/InternalBackendManager.cs 
b/src/libtasque/Core/Impl/InternalBackendManager.cs
index 52edb19..6c64328 100644
--- a/src/libtasque/Core/Impl/InternalBackendManager.cs
+++ b/src/libtasque/Core/Impl/InternalBackendManager.cs
@@ -43,7 +43,7 @@ namespace Tasque.Core.Impl
                        this.preferences = preferences;
                        
                        availableBackendNodes = AddinManager
-                               .GetExtensionNodes<BackendNode> (typeof(IBackend2));
+                               .GetExtensionNodes<BackendNode> (typeof(IBackend));
 
                        taskLists = new TaskListCollection ();
                }
@@ -166,7 +166,7 @@ namespace Tasque.Core.Impl
                                n => n.Id == currentBackend);
                        Logger.Info ("Using backend: {0} ({1})",
                                     node.Data.Name, currentBackend);
-                       backend = (IBackend2)node.CreateInstance ();
+                       backend = (IBackend)node.CreateInstance ();
                        backend.NeedsConfiguration += delegate {
                                if (BackendConfigurationRequested != null)
                                        BackendConfigurationRequested (this, EventArgs.Empty);
@@ -194,7 +194,7 @@ namespace Tasque.Core.Impl
                }
 
                ExtensionNodeList<BackendNode> availableBackendNodes;
-               IBackend2 backend;
+               IBackend backend;
                string currentBackend;
                IPreferences preferences;
                TaskListCollection taskLists;
diff --git a/src/libtasque/Data/IBackend.cs b/src/libtasque/Data/IBackend.cs
index 394f08c..194970b 100644
--- a/src/libtasque/Data/IBackend.cs
+++ b/src/libtasque/Data/IBackend.cs
@@ -1,98 +1,94 @@
-// ITaskBackend.cs created with MonoDevelop
-// User: boyd at 7:02 AMĀ 2/11/2008
-
+//
+// IBackend.cs
+//
+// Author:
+//       Antonius Riha <antoniusriha gmail com>
+//
+// Copyright (c) 2013 Antonius Riha
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
 using System;
 using System.Collections.Generic;
+using Mono.Addins;
 
-namespace Tasque.Backends
+namespace Tasque.Data
 {
-       /// <summary>
-       /// This is the main integration interface for different backends that
-       /// Tasque can use.
-       /// </summary>
-       public interface IBackend : IDisposable
+       [TypeExtensionPoint (ExtensionAttributeType =
+                            typeof (BackendExtensionAttribute))]
+       public interface IBackend : IDisposable,
+               IRepositoryProvider<INoteRepository>,
+               IRepositoryProvider<ITaskListRepository>,
+               IRepositoryProvider<ITaskRepository>
        {
-               event EventHandler BackendInitialized;
-               event EventHandler BackendSyncStarted;
-               event EventHandler BackendSyncFinished;
-
-               #region Properties
-               /// <value>
-               /// A human-readable name for the backend that will be displayed in the
-               /// preferences dialog to allow the user to select which backend Tasque
-               /// should use.
-               /// </value>
-               string Name
-               {
-                       get;
-               }
-               
-               /// <value>
-               /// All the tasks provided by the backend.
-               /// </value>
-               ICollection<Task> Tasks
-               {
-                       get;
-               }
-               
-               /// <value>
-               /// This returns all the ITaskList items from the backend.
-               /// </value>
-               ICollection<TaskList> TaskLists
-               {
-                       get;
-               }
-               
-               /// <value>
-               /// Indication that the backend has enough information
-               /// (credentials/etc.) to run.  If false, the properties dialog will
-               /// be shown so the user can configure the backend.
-               /// </value>
-               bool Configured
-               {
-                       get;
-               }
-               
-               /// <value>
-               /// Inidication that the backend is initialized
-               /// </value>
-               bool Initialized
-               {
-                       get;
-               }
-               
-               /// <summary>
-               /// An object that provides a means of managing backend specific preferences.
-               /// </summary>
-               /// <returns>
-               /// A <see cref="Tasque.Backends.IBackendPreferences"/>
-               /// </returns>
+               bool IsConfigured { get; }
+               bool IsInitialized { get; }
                IBackendPreferences Preferences { get; }
-               #endregion // Properties
-               
-               #region Methods
+
                /// <summary>
-               /// Create a new task.
+               /// Initializes the backend.
                /// </summary>
-               Task CreateTask (string taskName, TaskList list);
+               /// <param name='preferences'>
+               /// An object to access Tasque preferences.
+               /// </param>
+               /// <exception cref="T:Tasque.BackendInitializationException">
+               /// thrown when the initialization of the backend fails.
+               /// </exception>
+               void Initialize (IPreferences preferences);
 
                /// <summary>
-               /// Deletes the specified task.
+               /// Gets all task lists populated with tasks, which in turn are
+               /// populated with notes and possibly nested tasks.
                /// </summary>
-               /// <param name="task">
-               /// A <see cref="Task"/>
-               /// </param>
-               void DeleteTask (Task task);
+               /// <returns>
+               /// The lists.
+               /// </returns>
+               /// <exception cref="T:Tasque.TransactionException">
+               /// thrown when the transaction failed to commit on the backend
+               /// </exception>
+               IEnumerable<ITaskListCore> GetAll ();
+
+               ITaskListCore GetBy (string id);
                
                /// <summary>
-               /// Refreshes the backend.
+               /// Create the specified task list on the backend.
                /// </summary>
-               void Refresh();
+               /// <param name='item'>
+               /// The list to create.
+               /// </param>
+               /// <exception cref="T:Tasque.TransactionException">
+               /// thrown when the transaction failed to commit on the backend
+               /// </exception>
+               void Create (ITaskListCore taskList);
                
                /// <summary>
-               /// Initializes the backend
+               /// Delete the specified task list.
                /// </summary>
-               void Initialize (IPreferences preferences);
-               #endregion // Methods
+               /// <param name='item'>
+               /// The list.
+               /// </param>
+               /// <exception cref="T:Tasque.TransactionException">
+               /// thrown when the transaction failed to commit on the backend
+               /// </exception>
+               void Delete (ITaskListCore taskList);
+
+               event EventHandler Disposed;
+               event EventHandler Initialized;
+               event EventHandler NeedsConfiguration;
        }
 }
diff --git a/src/libtasque/libtasque.csproj b/src/libtasque/libtasque.csproj
index bdda7eb..8011aa6 100644
--- a/src/libtasque/libtasque.csproj
+++ b/src/libtasque/libtasque.csproj
@@ -64,15 +64,12 @@
     <Compile Include="DateFormatters\RegularExpressionFormatter.cs" />
     <Compile Include="DateFormatters\DateFormatterFactory.cs" />
     <Compile Include="Data\BackendExtensionAttribute.cs" />
-    <Compile Include="Data\BackendInitializationException.cs" />
-    <Compile Include="Data\IBackend2.cs" />
     <Compile Include="Data\IBackendPreferences.cs" />
     <Compile Include="Data\INoteRepository.cs" />
     <Compile Include="Data\IRepository.cs" />
     <Compile Include="Data\ITaskListRepository.cs" />
     <Compile Include="Data\ITaskRepository.cs" />
     <Compile Include="Data\IRepositoryProvider.cs" />
-    <Compile Include="Data\TransactionException.cs" />
     <Compile Include="IPreferences.cs" />
     <Compile Include="Data\ICollectionRepository.cs" />
     <Compile Include="Data\TasqueObjectFactory.cs" />
@@ -112,6 +109,7 @@
     <Compile Include="Core\TaskListType.cs" />
     <Compile Include="IContainee.cs" />
     <Compile Include="TaskState.cs" />
+    <Compile Include="Data\IBackend.cs" />
   </ItemGroup>
   <ItemGroup>
     <Folder Include="DateFormatters\" />
@@ -122,7 +120,4 @@
     <Folder Include="Utils\" />
   </ItemGroup>
   <Import Project="..\..\build\X.Common.targets" />
-  <ItemGroup>
-    <None Include="Data\IBackend.cs" />
-  </ItemGroup>
 </Project>


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