@@ -21,14 +21,18 @@ namespace AutoHDR
2121 public class ApplicationItem : BaseViewModel , IEquatable < ApplicationItem >
2222 {
2323 private bool _isUWP = false ;
24+ private bool _isUWPWebApp = false ;
25+
2426 private string displayName ;
2527 private string _applicationFilePath ;
2628 private string _applicationName ;
2729 private System . Drawing . Bitmap icon = null ;
2830 //private bool _restartProcess = false;
29- private string _uwpFamilyPackageName ;
30- private string _uwpApplicationID ;
31- private string _uwpIconPath ;
31+ private string _uwpFamilyPackageName = string . Empty ;
32+ private string _uwpApplicationID = string . Empty ;
33+ private string _uwpIconPath = string . Empty ;
34+ private string _uwpIdentity = string . Empty ;
35+
3236
3337 [ JsonProperty ]
3438 public string DisplayName { get => displayName ; set { displayName = value ; OnPropertyChanged ( ) ; } }
@@ -39,15 +43,18 @@ public class ApplicationItem : BaseViewModel, IEquatable<ApplicationItem>
3943 // public bool RestartProcess { get => _restartProcess; set { _restartProcess = value; OnPropertyChanged(); } }
4044 [ JsonProperty ]
4145 public bool IsUWP { get => _isUWP ; set { _isUWP = value ; OnPropertyChanged ( ) ; } }
42-
46+ [ JsonProperty ]
47+ public bool IsUWPWepApp { get => _isUWPWebApp ; set { _isUWPWebApp = value ; OnPropertyChanged ( ) ; } }
4348 public Bitmap Icon { get => icon ; set { icon = value ; OnPropertyChanged ( ) ; } }
4449 [ JsonProperty ]
4550 public string UWPFamilyPackageName { get => _uwpFamilyPackageName ; set { _uwpFamilyPackageName = value ; OnPropertyChanged ( ) ; } }
4651 [ JsonProperty ]
4752 public string UWPApplicationID { get => _uwpApplicationID ; set { _uwpApplicationID = value ; OnPropertyChanged ( ) ; } }
4853 [ JsonProperty ]
4954 public string UWPIconPath { get => _uwpIconPath ; set { _uwpIconPath = value ; try { Icon = new Bitmap ( Bitmap . FromFile ( value ) ) ; } catch { } OnPropertyChanged ( ) ; } }
50-
55+
56+ [ JsonProperty ]
57+ public string UWPIdentity { get => _uwpIdentity ; set { _uwpIdentity = value ; OnPropertyChanged ( ) ; } }
5158
5259 private ApplicationItem ( )
5360 {
@@ -60,38 +67,18 @@ public ApplicationItem(string displayName, string applicationFilePath)
6067 ApplicationName = new FileInfo ( ApplicationFilePath ) . Name . Replace ( ".exe" , "" ) ;
6168 }
6269
63- public ApplicationItem ( string displayName , string applicationFilePath , string uwpFamilyPackageName , string uwpApplicationID , string iconPath = "" ) : this ( displayName , applicationFilePath )
70+ public ApplicationItem ( UWP . UWPApp uwpApp ) : this ( uwpApp . Name , uwpApp . ExecutablePath )
6471 {
6572 IsUWP = true ;
66- UWPFamilyPackageName = uwpFamilyPackageName ;
67- UWPApplicationID = uwpApplicationID ;
68- UWPIconPath = iconPath ;
73+ IsUWPWepApp = true ;
74+ UWPFamilyPackageName = uwpApp . FamilyPackageName ;
75+ UWPApplicationID = uwpApp . ApplicationID ;
76+ UWPIconPath = uwpApp . IconPath ;
77+ UWPIdentity = uwpApp . Identity ;
6978 }
7079
71-
7280 Dictionary < ApplicationItem , ApplicationState > _lastAppStates = new Dictionary < ApplicationItem , ApplicationState > ( ) ;
7381
74-
75- //private void UpdateRestartAppStates(IDictionary<ApplicationItem, ApplicationState> applicationStates, bool restartApps)
76- //{
77- // Dictionary<ApplicationItem, ApplicationState> newLastAppStates = new Dictionary<ApplicationItem, ApplicationState>();
78- // Globals.Logs.Add($"Updating application states...", false);
79- // foreach (var applicationState in applicationStates)
80- // {
81- // newLastAppStates.Add(applicationState.Key, applicationState.Value);
82-
83- // if (applicationState.Key.RestartProcess && restartApps)
84- // {
85- // if (!_lastAppStates.ContainsKey(applicationState.Key) && applicationState.Value != ApplicationState.None)
86- // RestartProcess(applicationState.Key);
87- // else if (_lastAppStates.ContainsKey(applicationState.Key) && applicationState.Value != ApplicationState.None && _lastAppStates[applicationState.Key] == ApplicationState.None)
88- // RestartProcess(applicationState.Key);
89- // }
90- // }
91- // _lastAppStates.Clear();
92- // _lastAppStates = newLastAppStates;
93- //}
94-
9582 public void Restart ( )
9683 {
9784 try
0 commit comments