-
Notifications
You must be signed in to change notification settings - Fork 74
Expand file tree
/
Copy pathProject.cs
More file actions
62 lines (55 loc) · 2.28 KB
/
Copy pathProject.cs
File metadata and controls
62 lines (55 loc) · 2.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
using System;
using System.ComponentModel;
using System.Globalization;
using System.Windows.Data;
namespace UnityLauncherPro
{
public class Project : IValueConverter, INotifyPropertyChanged
{
public string Title { set; get; }
public string Version { set; get; }
public string Path { set; get; }
public DateTime? Modified { set; get; }
public string Arguments { set; get; }
public string GITBranch { set; get; } // TODO rename to Branch
//public string TargetPlatform { set; get; }
public string TargetPlatform { set; get; } // TODO rename to Platform
public string[] TargetPlatforms { set; get; }
public bool folderExists { set; get; }
public string SRP { set; get; } // Scriptable Render Pipeline, TODO add version info?
//public string InfoLabel { set; get; } // this is additional info from Releases API (like vulnerabilities..)
private string _infoLabel;
public string InfoLabel
{
get => _infoLabel;
set
{
if (_infoLabel == value) return;
_infoLabel = value;
OnPropertyChanged(nameof(InfoLabel));
}
}
// WPF keeps calling this method from AppendFormatHelper, GetNameCore..? not sure if need to return something else or default would be faster?
public override string ToString()
{
return Path;
}
// for debugging
//public override string ToString()
//{
// return $"{Title} {Version} {Path} {Modified} {Arguments} {GITBranch} {TargetPlatform}";
//}
// change datagrid colors based on value using converter https://stackoverflow.com/a/5551986/5452781
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
bool b = (bool)value;
return b;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotSupportedException();
}
public event PropertyChangedEventHandler PropertyChanged;
protected void OnPropertyChanged(string name) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
}
}