move logic to Core project and create UI project with UI lol #1
2 changed files with 8 additions and 2 deletions
|
|
@ -25,6 +25,11 @@ public class AdbService : IAdbService
|
||||||
var server = new AdbServer();
|
var server = new AdbServer();
|
||||||
var serverStatus = server.StartServer(adbPath, restartServerIfNewer: false);
|
var serverStatus = server.StartServer(adbPath, restartServerIfNewer: false);
|
||||||
_adbClient = new AdbClient();
|
_adbClient = new AdbClient();
|
||||||
|
RefreshDeviceData();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RefreshDeviceData()
|
||||||
|
{
|
||||||
var devices = _adbClient.GetDevices();
|
var devices = _adbClient.GetDevices();
|
||||||
_deviceData = devices.FirstOrDefault();
|
_deviceData = devices.FirstOrDefault();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ public partial class MainWindow : Window
|
||||||
{
|
{
|
||||||
private string? _apkPath;
|
private string? _apkPath;
|
||||||
private string? _zipPath;
|
private string? _zipPath;
|
||||||
private readonly AdbService _adbService;
|
private AdbService _adbService;
|
||||||
|
|
||||||
private const int PROGRESS_LOG_STEP = 10;
|
private const int PROGRESS_LOG_STEP = 10;
|
||||||
private const int PROGRESS_UPDATE_STEP = 1;
|
private const int PROGRESS_UPDATE_STEP = 1;
|
||||||
|
|
@ -179,6 +179,8 @@ public partial class MainWindow : Window
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_adbService.RefreshDeviceData();
|
||||||
|
|
||||||
InstallButton.IsEnabled = false;
|
InstallButton.IsEnabled = false;
|
||||||
InstallProgressBar.Value = 0;
|
InstallProgressBar.Value = 0;
|
||||||
|
|
||||||
|
|
@ -222,7 +224,6 @@ public partial class MainWindow : Window
|
||||||
var timestamp = DateTime.Now.ToString("HH:mm:ss");
|
var timestamp = DateTime.Now.ToString("HH:mm:ss");
|
||||||
LogsTextBox.Text += $"[{timestamp}] {message}\n";
|
LogsTextBox.Text += $"[{timestamp}] {message}\n";
|
||||||
|
|
||||||
// Прокручиваем к концу
|
|
||||||
var scrollViewer = LogsTextBox.FindAncestorOfType<ScrollViewer>();
|
var scrollViewer = LogsTextBox.FindAncestorOfType<ScrollViewer>();
|
||||||
scrollViewer?.ScrollToEnd();
|
scrollViewer?.ScrollToEnd();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue