private void backgroundWorkerDB_RunWorkerCompleted_1(object sender, RunWorkerCompletedEventArgs e) { toolStripStatusLabel.Text = "Preparing disk..."; toolStripStatusLabel.Invalidate(); if (e.Error == null) { FolderItem result = (FolderItem)e.Result; foreach (FolderItem item in result.Children) { treeView.Nodes.Clear(); treeView.Nodes.Add(result.FolderNode); } FolderToDb.DoBulkInsert(); FolderToDb.SqlCon.Close(); toolStripStatusLabel.Text = "Finnished analyzing"; } else { toolStripStatusLabel.Text = "Unexpected error during disk analysis"; } toolBar.Enabled = true; treeView.Nodes[0].Toggle(); }
private void backgroundWorkerDB_DoWork_1(object sender, DoWorkEventArgs e) { sendToDB = new FolderToDb(scannedpath, backgroundWorkerDB, txDatasource.Text); //sendToDB.ConStr = txDatasource.Text; FolderItem root = sendToDB.AnalyzeFolder(); e.Result = root; }