private void backGroundWorker_DoWork(object sender, DoWorkEventArgs e) { System.ComponentModel.BackgroundWorker worker; worker = (System.ComponentModel.BackgroundWorker)sender; CarSensX.Sensors.SensorList sList = (CarSensX.Sensors.SensorList)e.Argument; sList.initialize(worker, e); }
private void GenerateStructure() { DataColumn type = new DataColumn(); DataColumn name = new DataColumn(); DataColumn sensor = new DataColumn(); type.DataType = Type.GetType("CarSensX.Sensors.SensorType"); sensor.DataType = Type.GetType("CarSensX.Sensors.Sensor"); termo = new DataTable("Thermo"); termo.Columns.Add(type); termo.Columns.Add(name); termo.Columns.Add(sensor); therms = new SensorListThermo(termo); System.IO.MemoryStream stream = new System.IO.MemoryStream(); termo.WriteXmlSchema(stream, true); gps = new DataTable(); stream.Position = 0; gps.ReadXmlSchema(stream); gps.TableName = "GPS"; gpss = new SensorListGPS(gps); volts = new DataTable(); stream.Position = 0; volts.ReadXmlSchema(stream); volts.TableName = "VOLTS"; voltslist = new SensorListVolt(volts); this.updateSensorTables(); thermFinderWorker.RunWorkerAsync(therms); gpsFinderWorker.RunWorkerAsync(gpss); }