private void setStbProperties_DoWork(object sender, DoWorkEventArgs e) { PropertyEntity property = (PropertyEntity)e.Argument; string cmd = "adb shell setprop" + property.Name + " " + property.Value; excuteCmd(cmd); }
private void setStbProperties(string propertyKey, string propertyValue) { BackgroundWorker setPropertiesWork = new BackgroundWorker(); setPropertiesWork.WorkerReportsProgress = false; setPropertiesWork.DoWork += setStbProperties_DoWork; setPropertiesWork.RunWorkerCompleted += setStbProperties_RunWorkerCompleted; PropertyEntity property = new PropertyEntity { Name = propertyKey, Value = propertyValue }; setPropertiesWork.RunWorkerAsync(property); }
private void Lv_propertyInfo_MouseDoubleClick(object sender, MouseButtonEventArgs e) { PropertyEntity propertyEntity = ((ListViewItem)sender).Content as PropertyEntity; string propertyKey = propertyEntity.Name; Console.WriteLine(propertyKey); //MessageBox.Show("更改", "修改属性", MessageBoxButton.OK, MessageBoxImage.Information); CustomInputDialog inputDialog = new CustomInputDialog("请输入需要修改为的属性值:"); if (inputDialog.ShowDialog() == true) { String value = inputDialog.Value; Console.WriteLine(value); if (!string.IsNullOrEmpty(value)) { setStbProperties(propertyKey, value); } } }