| 1 | using Core.Enums; |
| 2 | using System; |
| 3 | using System.Collections.Generic; |
| 4 | using System.Linq; |
| 5 | using System.Security.AccessControl; |
| 6 | using System.Text; |
| 7 | using System.Threading.Tasks; |
| 8 | |
| 9 | namespace Core.Models.AppObserver |
| 10 | { |
| 11 | ///<summary> |
| 12 | /// |
| 13 | ///</summary> |
| 14 | public class AppInfo |
| 15 | { |
| 16 | ///<summary> |
| 17 | /// |
| 18 | ///</summary> |
| 19 | public int PID { get; } |
| 20 | ///<summary> |
| 21 | /// |
| 22 | ///</summary> |
| 23 | public AppType Type { get; } |
| 24 | ///<summary> |
| 25 | /// |
| 26 | ///</summary> |
| 27 | public string Process { get; } |
| 28 | ///<summary> |
| 29 | /// |
| 30 | ///</summary> |
| 31 | public string Description { get; } |
| 32 | ///<summary> |
| 33 | /// |
| 34 | ///</summary> |
| 35 | public string ExecutablePath { get; } |
| 36 | ///<summary> |
| 37 | /// |
| 38 | ///</summary> |
| 39 | public IntPtr WindowHandle { get; } |
| 40 | public AppInfo(IntPtr windowHandle_, int pid_, string process_, string description_, string executablePath_, AppType type_ = AppType.Win32) |
| 41 | { |
| 42 | WindowHandle = windowHandle_; |
| 43 | PID = pid_; |
| 44 | Process = process_; |
| 45 | Description = description_; |
| 46 | ExecutablePath = executablePath_; |
| 47 | Type = type_; |
| 48 | } |
| 49 | |
| 50 | public override string ToString() |
| 51 | { |
| 52 | return $"WindowHandle:{WindowHandle},PID:{PID},ProcessName:{Process},Description:{Description},ExecutablePath:{ExecutablePath},Type:{Type}"; |
| 53 | } |
| 54 | |
| 55 | public static AppInfo Empty = new AppInfo(IntPtr.Zero, 0, string.Empty, string.Empty, string.Empty); |
| 56 | } |
| 57 | } |