-
Notifications
You must be signed in to change notification settings - Fork 74
/
Copy pathSettings.cs
executable file
·169 lines (129 loc) · 4.71 KB
/
Settings.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
//
// This is the source code of Telegram for Windows Phone v. 3.x.x.
// It is licensed under GNU GPL v. 2 or later.
// You should have received a copy of the license in this archive (see LICENSE).
//
// Copyright Evgeny Nadymov, 2013-present.
//
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using Telegram.Api.Services;
using TelegramClient.ViewModels.Additional;
namespace TelegramClient.Models
{
public class Settings : TelegramPropertyChangedBase
{
public Settings()
{
IsNotifying = false;
}
protected bool SetField<T>(ref T field, T value, string propertyName)
{
if (EqualityComparer<T>.Default.Equals(field, value)) return false;
field = value;
NotifyOfPropertyChange(propertyName);
return true;
}
protected bool SetField<T>(ref T field, T value, Expression<Func<T>> selectorExpression)
{
if (EqualityComparer<T>.Default.Equals(field, value)) return false;
field = value;
NotifyOfPropertyChange(selectorExpression);
return true;
}
#region Message Notifications
public bool _contactAlert = true;
public bool ContactAlert
{
get { return _contactAlert; }
set { SetField(ref _contactAlert, value, () => ContactAlert); }
}
public bool _contactMessagePreview = true;
public bool ContactMessagePreview
{
get { return _contactMessagePreview; }
set { SetField(ref _contactMessagePreview, value, () => ContactMessagePreview); }
}
public string _contactSound;
public string ContactSound
{
get { return _contactSound; }
set { SetField(ref _contactSound, value, () => ContactSound); }
}
#endregion
#region Group Notifications
public bool _groupAlert = true;
public bool GroupAlert
{
get { return _groupAlert; }
set { SetField(ref _groupAlert, value, () => GroupAlert); }
}
public bool _groupMessagePreview = true;
public bool GroupMessagePreview
{
get { return _groupMessagePreview; }
set { SetField(ref _groupMessagePreview, value, () => GroupMessagePreview); }
}
public string _groupSound;
public string GroupSound
{
get { return _groupSound; }
set { SetField(ref _groupSound, value, () => GroupSound); }
}
#endregion
#region In-App Notifications
public bool _inAppVibration = true;
public bool InAppVibration
{
get { return _inAppVibration; }
set { SetField(ref _inAppVibration, value, () => InAppVibration); }
}
public bool _inAppSound = true;
public bool InAppSound
{
get { return _inAppSound; }
set { SetField(ref _inAppSound, value, () => InAppSound); }
}
public bool _inAppMessagePreview = true;
public bool InAppMessagePreview
{
get { return _inAppMessagePreview; }
set { SetField(ref _inAppMessagePreview, value, () => InAppMessagePreview); }
}
#endregion
public bool _locationServices = false;
public bool LocationServices
{
get { return _locationServices; }
set { SetField(ref _locationServices, value, () => LocationServices); }
}
public bool _peopleHub = false;
public bool PeopleHub
{
get { return _peopleHub; }
set { SetField(ref _peopleHub, value, () => PeopleHub); }
}
public bool AskAllowingLocationServices = false;
public bool _saveIncomingPhotos = false;
public bool SaveIncomingPhotos
{
get { return _saveIncomingPhotos; }
set { SetField(ref _saveIncomingPhotos, value, () => SaveIncomingPhotos); }
}
public BackgroundItem _background;
public BackgroundItem Background
{
get { return _background; }
set { SetField(ref _background, value, () => Background); }
}
public bool SendByEnter { get; set; }
public bool InvisibleMode { get; set; }
public bool _contactJoined = true;
public bool ContactJoined
{
get { return _contactJoined; }
set { SetField(ref _contactJoined, value, () => ContactJoined); }
}
}
}