コード例 #1
0
        public static void ScanFiles(object sender, DoWorkEventArgs e)
        {
            deep             = false;
            _bgw             = sender as BackgroundWorker;
            Program.SyncCont = e.Argument as SynchronizationContext;
            if (Program.SyncCont == null)
            {
                _bgw = null;
                return;
            }

            bool any = false;
            int  i   = 0;

            while (AppSettings.ReadSetting("Depot" + i) != null)
            {
                any = true;
                ScanRomRoot(AppSettings.ReadSetting("Depot" + i));
                i++;
            }

            if (!any)
            {
                ScanRomRoot(@"RomRoot");
            }

            //for (int i = 0; i < 256; i++)
            //    ScanRomRoot(RomRootDir.GetRootDir((byte)i));

            DatUpdate.UpdateGotTotal();
            _bgw.ReportProgress(0, new bgwText("Scanning Files Complete"));
            _bgw             = null;
            Program.SyncCont = null;
        }
コード例 #2
0
ファイル: frmMain.cs プロジェクト: vidarw/RVWorld
        public frmMain()
        {
            InitializeComponent();
            Text = $@"RomVaultX {Application.StartupPath}";

            string driveLetter = AppSettings.ReadSetting("vDriveLetter");

            if (driveLetter == null)
            {
                AppSettings.AddUpdateAppSettings("vDriveLetter", "V");

                driveLetter = AppSettings.ReadSetting("vDriveLetter");
            }
            vDriveLetter = driveLetter.ToCharArray()[0];

            addGameGrid();
            string res = Program.db.ConnectToDB();

            if (!string.IsNullOrEmpty(res))
            {
                MessageBox.Show("res", "DB Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Close();
            }

            DatUpdate.UpdateGotTotal();
            DirTree.Setup(RvTreeRow.ReadTreeFromDB());
        }
コード例 #3
0
        public static void ScanFilesDeep(object sender, DoWorkEventArgs e)
        {
            deep             = true;
            _bgw             = sender as BackgroundWorker;
            Program.SyncCont = e.Argument as SynchronizationContext;
            if (Program.SyncCont == null)
            {
                _bgw = null;
                return;
            }

            for (int i = 0; i < 256; i++)
            {
                ScanRomRoot(RomRootDir.GetRootDir((byte)i));
                if (_bgw.CancellationPending)
                {
                    break;
                }
            }

            DatUpdate.UpdateGotTotal();
            _bgw.ReportProgress(0, new bgwText("Scanning Files Complete"));
            _bgw             = null;
            Program.SyncCont = null;
        }
コード例 #4
0
        public static void ScanFiles(object sender, DoWorkEventArgs e)
        {
            string sInMemorySize = AppSettings.ReadSetting("ScanInMemorySize");

            if (sInMemorySize == null)
            {
                // I use 1000000
                AppSettings.AddUpdateAppSettings("ScanInMemorySize", "1000000");
                sInMemorySize = AppSettings.ReadSetting("ScanInMemorySize");
            }

            if (!ulong.TryParse(sInMemorySize, out _inMemorySize))
            {
                _inMemorySize = 1000000;
            }

            _tmpDir = AppSettings.ReadSetting("ScanInDir") ?? "tmp";
            if (!Directory.Exists(_tmpDir))
            {
                Directory.CreateDirectory(_tmpDir);
            }

            _bgw             = sender as BackgroundWorker;
            Program.SyncCont = e.Argument as SynchronizationContext;
            if (Program.SyncCont == null)
            {
                _bgw = null;
                return;
            }

            ScanADirNew(RootDir);

            DatUpdate.UpdateGotTotal();
            _bgw?.ReportProgress(0, new bgwText("Scanning Files Complete"));
            _bgw             = null;
            Program.SyncCont = null;
        }