public void Open(string volume, bool silent = false)
        {
            Volume = new DriveVolume();

            DriveName = volume;

            if (!silent)
            {
                StatusString = "Opening volume " + volume;
            }

            if (!Volume.Open(volume))
            {
                if (!silent)
                {
                    StatusString  = "Error opening volume " + volume;
                    StatusPercent = 100.0f;
                }

                Error = true;
                Done  = true;

                VolumeOpen = false;

                return;
            }

            VolumeOpen = true;

            if (!silent)
            {
                StatusString = "Getting volume bitmap";
            }

            if (!Volume.GetBitmap())
            {
                if (!silent)
                {
                    StatusString = "Could not get volume " + DriveName + " bitmap";
                }

                Error = true;

                Close();

                return;
            }

            UpdateDrawing = true;
        }
Example #2
0
        bool BuildDBCallback(ref FileInfo Info, ref SafeFileHandle FileHandle, ref BuildDBInfo DBInfo)
        {
            DriveVolume Vol = DBInfo.Volume;

            Vol.Files.Add(Info);

            if (DBInfo.QuitMonitor)
            {
                return(false);
            }

            DBInfo.ClusterProgress += Info.Clusters;
            DBInfo.Percent          = (DBInfo.ClusterProgress / (double)DBInfo.ClusterCount) * 100.0f;

            return(true);
        }
 public BuildDBInfo(Defragment defrag, DriveVolume volume, UInt64 clusterCount)
 {
     Defrag = defrag;
     Volume = volume;
     ClusterCount = clusterCount;
 }