private void bwRemoteViewer_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e)
        {
            RemoteViewerTask rvt = (RemoteViewerTask)e.Argument;

            switch (rvt.Job)
            {
            case RemoteViewerTask.Jobs.FETCH_LIST:
                sBwFetchlist();
                break;

            case RemoteViewerTask.Jobs.VIEW_FILE:
                sBwViewFile(rvt.RemoteFile);
                break;
            }

            e.Result = rvt;
        }
        private void lbFiles_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            if (lbFiles.SelectedItems.Count == 1 && (string)lbFiles.SelectedItem != "")
            {
                string fp = (string)lbFiles.SelectedItem;

                if (!bwRemoteViewer.IsBusy)
                {
                    RemoteViewerTask rvt = new RemoteViewerTask(RemoteViewerTask.Jobs.VIEW_FILE);
                    rvt.RemoteFile = fp;
                    bwRemoteViewer.RunWorkerAsync(rvt);
                }

                if (HelpersLib.GraphicsHelper.Core.IsValidImage(fp))
                {
                    pbViewer.Left = 0;
                    pbViewer.Top  = 0;
                }
            }
        }
        private void bwRemoteViewer_RunWorkerCompleted(object sender, System.ComponentModel.RunWorkerCompletedEventArgs e)
        {
            RemoteViewerTask rvt = (RemoteViewerTask)e.Result;

            switch (rvt.Job)
            {
            case RemoteViewerTask.Jobs.FETCH_LIST:
                sBar.Text = string.Format("Ready. Loaded {0} files.", lbFiles.Items.Count);
                break;

            case RemoteViewerTask.Jobs.VIEW_FILE:
                sBar.Text = string.Format("Showing {0}.", rvt.RemoteFile);
                break;
            }

            pBar.ProgressBar.Style = ProgressBarStyle.Continuous;

            sUpdateGuiControls();
            pBar.Value   = 0;
            pBar.Visible = false;
        }
 private void ViewRemote_Shown(object sender, System.EventArgs e)
 {
     RemoteViewerTask rvt = new RemoteViewerTask(RemoteViewerTask.Jobs.FETCH_LIST);
     bwRemoteViewer.RunWorkerAsync(rvt);
 }
        private void lbFiles_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            if (lbFiles.SelectedItems.Count == 1 && (string)lbFiles.SelectedItem != "")
            {
                string fp = (string)lbFiles.SelectedItem;

                if (!bwRemoteViewer.IsBusy)
                {
                    RemoteViewerTask rvt = new RemoteViewerTask(RemoteViewerTask.Jobs.VIEW_FILE);
                    rvt.RemoteFile = fp;
                    bwRemoteViewer.RunWorkerAsync(rvt);
                }

                if (HelpersLib.GraphicsHelper.Core.IsValidImage(fp))
                {
                    pbViewer.Left = 0;
                    pbViewer.Top = 0;
                }
            }
        }
        private void ViewRemote_Shown(object sender, System.EventArgs e)
        {
            RemoteViewerTask rvt = new RemoteViewerTask(RemoteViewerTask.Jobs.FETCH_LIST);

            bwRemoteViewer.RunWorkerAsync(rvt);
        }