//异步写内存 private void backgroundWorker2_DoWork(object sender, DoWorkEventArgs e) { FunctionBag bag = (FunctionBag)(e.Argument); bag.Rows = WriteItems(bag.Items, bag.Value); e.Result = bag.Rows; }
//异步读取内存 private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { FunctionBag bag = (FunctionBag)(e.Argument); bag.Rows = ReadItems(bag.Items, bag.IsReload); e.Result = bag.Rows; }