private void RefreshWorker_DoWork(object sender, DoWorkEventArgs e) { BackgroundWorker worker = sender as BackgroundWorker; string trashDirectory = MOG_ControllerProject.GetActiveUser().GetUserPath() + "\\Trash"; mSize = 0; ArrayList assets = MOG_DBInboxAPI.InboxGetAssetListWithProperties("Trash", MOG_ControllerProject.GetActiveUser().GetUserName(), "", ""); int i = 0; foreach (MOG_DBInboxProperties asset in assets) { // Create the properties for this asset MOG_Properties pProperties = new MOG_Properties(asset.mProperties); worker.ReportProgress(i, asset.mAsset.GetAssetName()); // Create the ListViewItem ListViewItem item = guiAssetManager.NewListViewItem(asset.mAsset, pProperties.Status, pProperties); if (!string.IsNullOrEmpty(pProperties.Size)) { mSize += long.Parse(pProperties.Size); } worker.ReportProgress(i, item); i++; } }
public ListViewItem[] RefreshUsersBox(BackgroundWorker worker, string desiredBox, string contentsFileDirectory) { MOG_Time now = new MOG_Time(); ArrayList assets = MOG_DBInboxAPI.InboxGetAssetListWithProperties(desiredBox, MOG_ControllerProject.GetActiveUser().GetUserName(), "", ""); ListViewItem[] items = new ListViewItem[assets.Count]; int x = 0; foreach (MOG_DBInboxProperties asset in assets) { // Create the properties for this asset MOG_Properties pProperties = new MOG_Properties(asset.mProperties); string message = "Refreshing:\n" + " " + asset.mAsset.GetAssetClassification() + "\n" + " " + asset.mAsset.GetAssetName(); worker.ReportProgress(x, message); // Update the ListViewItem ListViewItem item = guiAssetManager.NewListViewItem(asset.mAsset, pProperties.Status, pProperties); items[x++] = item; } return(items); }