Esempio n. 1
0
 private void ResetBackend(Exception ex)
 {
     try
     {
         if (m_backend != null)
         {
             m_backend.Dispose();
         }
     }
     catch (Exception dex)
     {
         Logging.Log.WriteWarningMessage(LOGTAG, "BackendDisposeError", dex, "Failed to dispose backend instance: {0}", ex.Message);
     }
     m_backend = null;
 }
Esempio n. 2
0
        private void Dispose(bool disposing)
        {
            if (!_disposed)
            {
                _disposed = true;

                if (disposing)
                {
                    if (_threadPool != null)
                    {
                        _threadPool.Dispose();
                    }
                }
            }
        }
Esempio n. 3
0
        void InitializeBackend()
        {
            var node = availableBackendNodes.Single (
                n => n.Id == currentBackend);
            Logger.Info ("Using backend: {0} ({1})",
                         node.Data.Name, currentBackend);
            backend = (IBackend)node.CreateInstance ();
            backend.NeedsConfiguration += delegate {
                if (BackendConfigurationRequested != null)
                    BackendConfigurationRequested (this, EventArgs.Empty);
            };
            backend.Initialized += delegate {
                // load data
                taskLists.LoadTaskLists (backend);
                if (BackendInitialized != null)
                    BackendInitialized (this, EventArgs.Empty);
            };

            try {
                backend.Initialize (preferences);
            } catch (Exception ex) {
                backend.Dispose ();
                backend = null;
                throw ex;
            }
        }
Esempio n. 4
0
        public void ReInitializeBackend()
        {
            ThrowIfDisposed ();
            if (currentBackend == null)
                return;

            if (backend != null) {
                Logger.Debug ("Cleaning up backend: {0}", backend.GetType ());
                backend.Disposed += delegate {
                    backend = null;
                    InitializeBackend ();
                };
                backend.Dispose ();
                taskLists.UnloadTaskLists ();
            } else
                InitializeBackend ();
        }
Esempio n. 5
0
 public void Dispose()
 {
     K.Dispose(this);
 }