-
Notifications
You must be signed in to change notification settings - Fork 4
/
Options.cs
99 lines (84 loc) · 2.35 KB
/
Options.cs
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NDI_Telestrator.Enums;
using System.Windows.Markup;
using System.ComponentModel;
namespace NDI_Telestrator
{
namespace Enums
{
#region Helpers
/// <summary>
/// https://stackoverflow.com/a/17405771
/// </summary>
public class EnumToItemsSource : MarkupExtension
{
private readonly Type _type;
public EnumToItemsSource(Type type)
{
_type = type;
}
public override object ProvideValue(IServiceProvider serviceProvider)
{
return Enum.GetValues(_type)
.Cast<object>()
.Select(e => new EnumDefinition(e));
}
}
class EnumDefinition
{
public EnumDefinition(Object obj)
{
Value = (int)obj;
DisplayName = obj.ToString();
}
public int Value { get; set; }
public string DisplayName { get; set; }
}
#endregion
public enum ScreenshotFormatTypes
{
JPG,
PNG
}
}
public static class Options // : INotifyPropertyChanged
{
#region Helpers
static void OnPropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string name = null)
{
PropertyChanged?.Invoke(null, new PropertyChangedEventArgs(name));
}
public static event PropertyChangedEventHandler PropertyChanged;
#endregion
private static ScreenshotFormatTypes _screenshotFormatType = ScreenshotFormatTypes.PNG;
public static ScreenshotFormatTypes screenshotFormatType
{
get
{
return _screenshotFormatType;
}
set
{
_screenshotFormatType = value;
OnPropertyChanged();
}
}
private static bool _quickSaveEnabled = true;
public static bool quickSaveEnabled
{
get
{
return _quickSaveEnabled;
}
set
{
_quickSaveEnabled = value;
OnPropertyChanged();
}
}
}
}