Exemplo n.º 1
0
 /// <summary>
 /// Internal event handler which is invoked when the gulu worker 
 /// is finished or terminated.
 /// </summary>
 /// <param name="sender">The sender of the event.</param>
 /// <param name="e">The event argument which carries the information
 /// of the running gulu and the way of terminating (Whether finished normally or
 /// terminated by user).</param>
 protected void OnGuluWorkerFinished(object sender, GuluWorkerFinishedEventArgs e)
 {
     // Hide the progress when the worker is interrupted or finished
     Progress.Hide();
     // Invokes the event
     if (Finished != null)
         Finished(sender, e);
 }
Exemplo n.º 2
0
        /// <summary>
        /// Fires when the gulu worker is finished
        /// </summary>
        /// <param name="sender">Finisher</param>
        /// <param name="e">The finishing event parameter, includes the current gulu and the finishing method.</param>
        private void worker___Finished(object sender, GuluWorkerFinishedEventArgs e)
        {
            if (this.InvokeRequired)
            {
                GuluWorker.GuluWorkerFinishedDelegate d = new GuluWorker.GuluWorkerFinishedDelegate(worker___Finished);
                this.Invoke(d, new object[] { sender, e });
            }
            else
            {

                Output.Add(SunnyChen.Gulu.Win.Properties.Resources.TEXT_DONE_GULU);
                e.Gulu.Done();

                if (e.Interrupted)
                    Output.Add(SunnyChen.Gulu.Win.Properties.Resources.TEXT_TERMINATED_USER);
                else
                    Output.Add(SunnyChen.Gulu.Win.Properties.Resources.TEXT_TERMINATED_NORMALLY);

                toolbarsManager.Tools["mnuStop"].SharedProps.Enabled = false;
                taskManager.Enabled = true;
                fileTreeView.Enabled = true;
                guluWorkerRunning__ = false;
            }
        }