Exemplo n.º 1
0
 void importerStatusChangedHandler(object sender, ImportStatusEventArgs e)
 {
     bool working = false;
     switch (e.Action)
     {
         case ImportAction.ImportStarted:
             restarting = false;
             working = true;
             break;
         case ImportAction.ImportResumed:
             working = true;
             break;
         case ImportAction.NewFilesFound:
             working = true;
             UpdateFacade();
             break;
         case ImportAction.ImportFinished:
             UpdateFacade();
             break;
         case ImportAction.ImportPaused:
             break;
         default:
             return;
     }
     GUIPropertyManager.SetProperty("#Emulators2.Importer.working", working ? "yes" : "no");
     Logger.LogDebug("Importer action: {0}", e.Action.ToString());
 }
Exemplo n.º 2
0
 protected virtual void OnImportStatusChanged(ImportStatusEventArgs e)
 {
     if (ImportStatusChanged != null)
         ImportStatusChanged(this, e);
 }
Exemplo n.º 3
0
 void importer_ImportStatusChanged(object sender, ImportStatusEventArgs e)
 {
     if (e.Action == ImportAction.PendingFilesAdded)
     {
         rebuildItemsList(e.NewItems);
     }
     else if(e.Action == ImportAction.NoFilesFound)
     {
         Progress = 100;
         Status = "[Emulators.Import.NoFilesToImport]";
     }
 }
Exemplo n.º 4
0
        void importer_ImportStatusChanged(object sender, ImportStatusEventArgs e)
        {
            if (closing)
                return;
            if (InvokeRequired)
            {
                try
                {
                    //Make sure we only execute on main thread
                    BeginInvoke(new MethodInvoker(delegate()
                    {
                        importer_ImportStatusChanged(sender, e);
                    }));
                }
                catch (ObjectDisposedException) { } //form closed
                return;
            }

            if (closing)
                return;
            if (e.Action == ImportAction.ImportStarting)
            {
                importerBindingSource.Clear();
                restarting = false;
                return;
            }
            else if (restarting)
                return;

            switch (e.Action)
            {
                case ImportAction.NoFilesFound:
                    progressBar.Visible = false;
                    progressLabel.Visible = true;
                    progressLabel.Text = NO_FILES_TO_IMPORT;
                    break;
                //occurs after DB refresh on importer load, add all files to grid
                case ImportAction.PendingFilesAdded:
                    addRow(e.NewItems);
                    break;
            }
        }