Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <returns>Return true to allow the application to terminate</returns>
        public static bool ApplicationShouldTerminate()
        {
            Logger.debug("ApplicationShouldTerminate");
            // Check if the automatic updater wants to install an update
            if (UpdateController.Instance.AboutToInstallUpdate)
            {
                return(true);
            }

            // Determine if there are any running transfers
            bool terminate = TransferController.ApplicationShouldTerminate();

            if (!terminate)
            {
                return(false);
            }

            // Determine if there are any open connections
            foreach (BrowserController controller in new List <BrowserController>(Browsers))
            {
                if (Preferences.instance().getBoolean("browser.serialize"))
                {
                    if (controller.IsMounted())
                    {
                        // The workspace should be saved. Serialize all open browser sessions
                        Host serialized = new Host(controller.getSession().getHost().getAsDictionary());
                        serialized.setWorkdir(controller.Workdir.getAbsolute());
                        Application._sessions.add(serialized);
                    }
                }
            }
            return(true);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <returns>Return true to allow the application to terminate</returns>
        public static bool ApplicationShouldTerminate()
        {
            Logger.debug("ApplicationShouldTerminate");

            // Determine if there are any running transfers
            bool terminate = TransferController.ApplicationShouldTerminate();

            if (!terminate)
            {
                return(false);
            }

            // Determine if there are any open connections
            foreach (BrowserController controller in new List <BrowserController>(Browsers))
            {
                if (PreferencesFactory.get().getBoolean("browser.serialize"))
                {
                    if (controller.IsMounted())
                    {
                        // The workspace should be saved. Serialize all open browser sessions
                        Host serialized =
                            new HostDictionary().deserialize(
                                controller.Session.getHost().serialize(SerializerFactory.get()));
                        serialized.setWorkdir(controller.Workdir);
                        Application._sessions.add(serialized);
                    }
                }
            }
            return(true);
        }
Ejemplo n.º 3
0
            public TransferBackgroundAction(TransferController controller, Transfer transfer, bool resumeRequested,
                                            bool reloadRequested) : base(controller)
            {
                _transfer   = transfer;
                _controller = controller;

                _resume = resumeRequested;
                _reload = reloadRequested;
            }
Ejemplo n.º 4
0
 public TransferBackgroundAction(TransferController controller, Transfer transfer, TransferOptions options,
                                 TransferCallback callback, PathCache cache, ProgressListener listener)
     : base(controller,
            null == transfer.getSource() ? SessionPool.DISCONNECTED : SessionPoolFactory.create(controller, transfer.getSource(), listener),
            null == transfer.getDestination() ? SessionPool.DISCONNECTED : SessionPoolFactory.create(controller, transfer.getDestination(), listener),
            controller.GetController(transfer),
            controller.GetController(transfer),
            transfer, options)
 {
     _transfer   = transfer;
     _callback   = callback;
     _controller = controller;
 }
Ejemplo n.º 5
0
 public LogAction(TransferController c, TranscriptListener.Type request, string msg) : base(c)
 {
     _request = request;
     _msg     = msg;
 }
Ejemplo n.º 6
0
 public TaskbarTransferAdapter(TransferController controller)
 {
     _controller = controller;
 }
Ejemplo n.º 7
0
 public LogAction(TransferController c, bool request, string msg)
     : base(c)
 {
     _request = request;
     _msg     = msg;
 }