Exemplo n.º 1
0
        } /* ViewSipperHeader */

        private void  LoadSipperFileListView()
        {
            SipperFileListView.Items.Clear();


            {
                ContextMenuStrip cms = new ContextMenuStrip();
                cms.Items.Add("View File", null, ViewSipperFile);
                cms.Items.Add("View Header Info", null, ViewSipperHeader);
                SipperFileListView.ContextMenuStrip = cms;
            }


            disk = null;
            try
            {
                disk = new SipperDisk(this.readDirFromLogFiles);
            }
            catch
            {
                if (disk != null)
                {
                    disk.Dispose();
                    disk = null;
                }
            }

            if (disk == null)
            {
                return;
            }

            SipperFileListView.Enabled = false;
            SipperFileListViewDisabled = true;

            partition = disk.GetSipperPartitionTableEntry();

            SipperFileControlBlockList files = disk.SipperFiles();

            foreach (SipperFileControlBlock fcb  in  files)
            {
                FcbListViewItem flvi = new FcbListViewItem(fcb);
                SipperFileListView.Items.Add(flvi);
            }

            SipperFileListViewDisabled = false;
            SipperFileListView.Enabled = true;
            UpdateSelectedBytes();
        } /* LoadSipperFileListView */
Exemplo n.º 2
0
        public DownLoadFiles(SipperDisk _disk,
                             SipperFileControlBlockList _filesToCopy,
                             string _destDir
                             )
        {
            disk        = _disk;
            filesToCopy = _filesToCopy;
            destDir     = _destDir;

            fileCopyStatsList = new List <FileCopyStats> ();

            InitializeComponent();

            BuildFileListView();

            downLoadingThread = new Thread(new ThreadStart(CopyFileList));
            downLoadingThread.Start();
        }
Exemplo n.º 3
0
        } /* SeeIfAllFilesHaveBeenDownLoaded */

        private void resetDirectoryToolStripMenuItem_Click(object sender, EventArgs e)
        {
            bool allFilesDownLoaded = SeeIfAllFilesHaveBeenDownLoaded();

            if (!allFilesDownLoaded)
            {
                DialogResult okToContinue =
                    MessageBox.Show("Not all SIPPER files have been downloaded" + "\n\n" +
                                    "    Are You Sure You Want To Continue ?",
                                    "Reset SIPPER Drive",
                                    MessageBoxButtons.YesNo
                                    );
                if (okToContinue == DialogResult.No)
                {
                    return;
                }
            }


            {
                DialogResult okToContinue =
                    MessageBox.Show("You have asked to reset the SIPPER drive; once" + "\n" +
                                    "we do this the data on the drive will be lost" + "\n\n" +
                                    "      Are You Sure You Want To Do This ?",
                                    "Reset SIPPER Drive",
                                    MessageBoxButtons.YesNo
                                    );
                if (okToContinue == DialogResult.No)
                {
                    return;
                }
            }

            disk.Dispose();
            disk = null;

            LoadSipperFileListView();
            UpdateAvailableBytes();
            selectedFiles = new SipperFileControlBlockList();

            disk.ResetSipperDirectory();
            MessageBox.Show("The SIPPER drive has been reset", "Reset SIPPER Drive", MessageBoxButtons.OK);
        }
Exemplo n.º 4
0
        private void CheckHardDriveTimer_Tick(object sender, EventArgs e)
        {
            // Lets see if the same Sipper Hard drive is plugged in
            if (disk == null)
            {
                // Since there was not a disk attached;  lets see if there is one now.
                try
                {
                    disk = new SipperDisk(readDirFromLogFiles);
                }
                catch (Exception)
                {
                    // Still no disk attached.
                    disk = null;
                    return;
                }

                disk.Dispose();
                disk = null;

                // There is a SIPPER drive attached mow;  lets refresh the screen.
                RefreshSipperDisk();
                return;
            }

            else
            {
                if (disk.SipperFilesOpenedCount() > 0)
                {
                    // If sipper files are opened for this drive;  we do not want to fool around with
                    return;
                }

                if (disk.AreWeTheSameDrive())
                {
                    return;
                }
            }

            // Not the same SIPPER drive loaded now.  We need to clear the screen
            RefreshSipperDisk();
        } /* CheckHardDriveTimer_Tick */