mirror of
https://github.com/BubbaGumpShrump/AutoTrackR2.git
synced 2025-05-04 09:45:29 +00:00
Location Data and CleanUp
This commit is contained in:
parent
855963ef39
commit
4c51e15fbd
4 changed files with 33 additions and 2 deletions
|
@ -7,7 +7,7 @@ namespace AutoTrackR2
|
|||
/// <summary>
|
||||
/// Interaction logic for App.xaml
|
||||
/// </summary>
|
||||
public partial class App : Application
|
||||
public partial class App : System.Windows.Application
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<UseWPF>true</UseWPF>
|
||||
<UseWindowsForms>false</UseWindowsForms>
|
||||
<Configurations>Debug;Release;Test</Configurations>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
<ApplicationIcon>AutoTrackR2.ico</ApplicationIcon>
|
||||
|
|
|
@ -483,8 +483,37 @@ function Read-LogEntry {
|
|||
}
|
||||
}
|
||||
|
||||
<#
|
||||
# Monitor the log file and process new lines as they are added
|
||||
Get-Content -Path $logFilePath -Wait -Tail 0 | ForEach-Object {
|
||||
Read-LogEntry $_
|
||||
}
|
||||
#>
|
||||
#>
|
||||
|
||||
# Open the log file with shared access for reading and writing
|
||||
$fileStream = [System.IO.FileStream]::new($logFilePath, [System.IO.FileMode]::Open, [System.IO.FileAccess]::Read, [System.IO.FileShare]::ReadWrite)
|
||||
$reader = [System.IO.StreamReader]::new($fileStream, [System.Text.Encoding]::UTF8) # Ensure we're reading as UTF-8
|
||||
|
||||
try {
|
||||
# Move to the end of the file to start monitoring new entries
|
||||
$reader.BaseStream.Seek(0, [System.IO.SeekOrigin]::End)
|
||||
|
||||
while ($true) {
|
||||
# Read the next line from the file
|
||||
$line = $reader.ReadLine()
|
||||
|
||||
# Ensure we have new content to process
|
||||
if ($line) {
|
||||
# Process the line (this is where your log entry handler would go)
|
||||
Read-LogEntry $line
|
||||
}
|
||||
|
||||
# Sleep for a brief moment to avoid high CPU usage
|
||||
Start-Sleep -Milliseconds 100
|
||||
}
|
||||
}
|
||||
finally {
|
||||
# Ensure we close the reader and file stream properly when done
|
||||
$reader.Close()
|
||||
$fileStream.Close()
|
||||
}
|
|
@ -11,6 +11,7 @@ namespace AutoTrackR2
|
|||
{
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
|
||||
private Dictionary<string, bool> tabStates = new Dictionary<string, bool>
|
||||
{
|
||||
{ "HomeTab", true }, // HomeTab is selected by default
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue