Refactor repo with ponytail cleanup (#31)
This commit is contained in:
+67
-87
@@ -1,87 +1,67 @@
|
||||
/*
|
||||
* ThreadPilot - Advanced Windows Process and Power Plan Manager
|
||||
* Copyright (C) 2025 Prime Build
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, version 3 only.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
namespace ThreadPilot.Models
|
||||
{
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
public enum ProcessClassification
|
||||
{
|
||||
ForegroundApp,
|
||||
VisibleWindowApp,
|
||||
BackgroundUser,
|
||||
System,
|
||||
ProtectedOrAccessDenied,
|
||||
Terminated,
|
||||
Unknown,
|
||||
}
|
||||
|
||||
public partial class ProcessModel : ObservableObject
|
||||
{
|
||||
[ObservableProperty]
|
||||
private int processId;
|
||||
|
||||
[ObservableProperty]
|
||||
private string name = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
private string executablePath = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
private double cpuUsage;
|
||||
|
||||
[ObservableProperty]
|
||||
private long memoryUsage;
|
||||
|
||||
[ObservableProperty]
|
||||
private ProcessPriorityClass priority;
|
||||
|
||||
[ObservableProperty]
|
||||
private long processorAffinity;
|
||||
|
||||
[ObservableProperty]
|
||||
private IntPtr mainWindowHandle;
|
||||
|
||||
[ObservableProperty]
|
||||
private string mainWindowTitle = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool hasVisibleWindow;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool isForeground;
|
||||
|
||||
[ObservableProperty]
|
||||
private ProcessClassification classification = ProcessClassification.Unknown;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool isIdleServerDisabled;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool isRegistryPriorityEnabled;
|
||||
|
||||
/// <summary>
|
||||
/// Forces PropertyChanged notification for ProcessorAffinity.
|
||||
/// Used to update DataGrid binding when affinity changes from background thread.
|
||||
/// </summary>
|
||||
public void ForceNotifyProcessorAffinityChanged()
|
||||
{
|
||||
this.OnPropertyChanged(nameof(this.ProcessorAffinity));
|
||||
}
|
||||
}
|
||||
}
|
||||
namespace ThreadPilot.Models
|
||||
{
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
public enum ProcessClassification
|
||||
{
|
||||
ForegroundApp,
|
||||
VisibleWindowApp,
|
||||
BackgroundUser,
|
||||
System,
|
||||
ProtectedOrAccessDenied,
|
||||
Terminated,
|
||||
Unknown,
|
||||
}
|
||||
|
||||
public partial class ProcessModel : ObservableObject
|
||||
{
|
||||
[ObservableProperty]
|
||||
private int processId;
|
||||
|
||||
[ObservableProperty]
|
||||
private string name = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
private string executablePath = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
private double cpuUsage;
|
||||
|
||||
[ObservableProperty]
|
||||
private long memoryUsage;
|
||||
|
||||
[ObservableProperty]
|
||||
private ProcessPriorityClass priority;
|
||||
|
||||
[ObservableProperty]
|
||||
private long processorAffinity;
|
||||
|
||||
[ObservableProperty]
|
||||
private IntPtr mainWindowHandle;
|
||||
|
||||
[ObservableProperty]
|
||||
private string mainWindowTitle = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool hasVisibleWindow;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool isForeground;
|
||||
|
||||
[ObservableProperty]
|
||||
private ProcessClassification classification = ProcessClassification.Unknown;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool isIdleServerDisabled;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool isRegistryPriorityEnabled;
|
||||
|
||||
public void ForceNotifyProcessorAffinityChanged()
|
||||
{
|
||||
this.OnPropertyChanged(nameof(this.ProcessorAffinity));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user